syslogstash 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/syslogstash +1 -1
- data/lib/syslogstash/logstash_writer.rb +6 -3
- data/lib/syslogstash.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85063132d60f932f245cee23fe386113bd2a470b
|
4
|
+
data.tar.gz: c4316c6c14830d325ee405dd30dabd26cd022071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 726a84230a8d06d8fd1889a4e3d915aa9b1e662657b1d7f460f969aae34a1c3e74bba0e80eb962793547ff2ca0b0930926cdad7528a010b42eb5d9581b191f45
|
7
|
+
data.tar.gz: f4bbc3b3abfd71c74c05f5ba449081b8cff1c393f4862f94dcf00f156ac74ac5ba1cd4f8998aa4ea42d9bafdf3bf576e61d956e7eb1c15fbc6152e0cd00ac85a
|
data/bin/syslogstash
CHANGED
@@ -10,8 +10,8 @@ class Syslogstash::LogstashWriter
|
|
10
10
|
# Give it a list of servers, and your writer will be ready to go.
|
11
11
|
# No messages will actually be *delivered*, though, until you call #run.
|
12
12
|
#
|
13
|
-
def initialize(servers)
|
14
|
-
@servers = servers.map { |s| URI(s) }
|
13
|
+
def initialize(servers, backlog)
|
14
|
+
@servers, @backlog = servers.map { |s| URI(s) }, @backlog
|
15
15
|
|
16
16
|
unless @servers.all? { |url| url.scheme == 'tcp' }
|
17
17
|
raise ArgumentError,
|
@@ -27,7 +27,10 @@ class Syslogstash::LogstashWriter
|
|
27
27
|
# #run.
|
28
28
|
#
|
29
29
|
def send_entry(e)
|
30
|
-
@entries_mutex.synchronize
|
30
|
+
@entries_mutex.synchronize do
|
31
|
+
@entries << e
|
32
|
+
@entries.shift while @entries.length > @backlog
|
33
|
+
end
|
31
34
|
@worker.run if @worker
|
32
35
|
end
|
33
36
|
|
data/lib/syslogstash.rb
CHANGED
@@ -6,8 +6,8 @@ require 'json'
|
|
6
6
|
# server.
|
7
7
|
#
|
8
8
|
class Syslogstash
|
9
|
-
def initialize(sockets, servers)
|
10
|
-
@writer = LogstashWriter.new(servers)
|
9
|
+
def initialize(sockets, servers, backlog)
|
10
|
+
@writer = LogstashWriter.new(servers, backlog)
|
11
11
|
|
12
12
|
@readers = sockets.map { |f, tags| SyslogReader.new(f, tags, @writer) }
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syslogstash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|