logstash-lite 0.2.20110422152244 → 0.2.20110505142231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/etc/client-amqp.conf +14 -0
- data/etc/logstash-redis-input.yaml +7 -0
- data/etc/logstash-redis-storage.yaml +6 -0
- data/etc/subscriber-amqp.conf +12 -0
- data/lib/logstash/inputs/redis.rb +31 -0
- data/lib/logstash/inputs/syslog.rb +2 -2
- data/lib/logstash/outputs/redis.rb +29 -0
- metadata +10 -4
@@ -0,0 +1,31 @@
|
|
1
|
+
require "logstash/inputs/base"
|
2
|
+
require "logstash/namespace"
|
3
|
+
require "em-redis"
|
4
|
+
|
5
|
+
class LogStash::Inputs::Redis < LogStash::Inputs::Base
|
6
|
+
public
|
7
|
+
def initialize(url, config={}, &block)
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
def register
|
12
|
+
_, @db, @queue = @url.path.split('/')
|
13
|
+
puts @url.host, @url.port, @db, @queue
|
14
|
+
EM.run do
|
15
|
+
redis = EM::Protocols::Redis.connect :host => @url.host, :port => @url.port, :db => @db
|
16
|
+
pop = lambda do
|
17
|
+
redis.blpop @queue, 0 do |response|
|
18
|
+
event = LogStash::Event.new({
|
19
|
+
"@message" => response,
|
20
|
+
"@type" => @type,
|
21
|
+
"@tags" => @tags.clone,
|
22
|
+
})
|
23
|
+
event.source = @url
|
24
|
+
@callback.call(event)
|
25
|
+
pop.call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
pop.call
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -23,8 +23,8 @@ class LogStash::Inputs::Syslog < LogStash::Inputs::Base
|
|
23
23
|
|
24
24
|
# This comes from RFC3164, mostly.
|
25
25
|
@@syslog_re ||= \
|
26
|
-
|
27
|
-
#<priority
|
26
|
+
/(?:<([0-9]{1,3})>)?([A-z]{3} ?[0-9]{1,2} [0-9]{2}:[0-9]{2}:[0-9]{2}) (?:(\S+[^:]) )?(.*)/
|
27
|
+
#<priority> timestamp Mmm dd hh:mm:ss host msg
|
28
28
|
end # def register
|
29
29
|
|
30
30
|
public
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require "logstash/outputs/base"
|
2
|
+
require "logstash/namespace"
|
3
|
+
require 'em-redis'
|
4
|
+
|
5
|
+
class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
6
|
+
|
7
|
+
def register
|
8
|
+
@port = nil
|
9
|
+
@password = nil
|
10
|
+
@host = @url.host
|
11
|
+
_, @db, @queue = @url.path.split('/')
|
12
|
+
require 'socket'
|
13
|
+
@hostname = Socket.gethostname
|
14
|
+
@work = []
|
15
|
+
@redis = EM::Protocols::Redis.connect({
|
16
|
+
:host => @host,
|
17
|
+
:port => @port,
|
18
|
+
:db => @db
|
19
|
+
})
|
20
|
+
end
|
21
|
+
|
22
|
+
def receive(event)
|
23
|
+
@redis.rpush(event.sprintf(@queue), {
|
24
|
+
:source_host => @hostname,
|
25
|
+
:source => event.source,
|
26
|
+
:message => event.message
|
27
|
+
}.to_json)
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 40221010284473
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 20110505142231
|
10
|
+
version: 0.2.20110505142231
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jordan Sissel
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-05-05 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
|
90
90
|
files:
|
91
91
|
- lib/logstash.rb
|
92
|
+
- lib/logstash/outputs/redis.rb
|
92
93
|
- lib/logstash/outputs/tcp.rb
|
93
94
|
- lib/logstash/outputs/websocket.rb
|
94
95
|
- lib/logstash/outputs/nagios.rb
|
@@ -200,6 +201,7 @@ files:
|
|
200
201
|
- lib/logstash/agent.rb
|
201
202
|
- lib/logstash/outputs.rb
|
202
203
|
- lib/logstash/time.rb
|
204
|
+
- lib/logstash/inputs/redis.rb
|
203
205
|
- lib/logstash/inputs/tcp.rb
|
204
206
|
- lib/logstash/inputs/syslog.rb
|
205
207
|
- lib/logstash/inputs/file.rb
|
@@ -234,7 +236,10 @@ files:
|
|
234
236
|
- etc/logstash-mongodb-storage.yaml
|
235
237
|
- etc/logstash-shipper.yaml
|
236
238
|
- etc/logstash-stomp.yaml
|
239
|
+
- etc/client-amqp.conf
|
240
|
+
- etc/logstash-redis-storage.yaml
|
237
241
|
- etc/logstash-nagios.yaml
|
242
|
+
- etc/logstash-redis-input.yaml
|
238
243
|
- etc/logstash-standalone.yaml
|
239
244
|
- etc/logstash-parser.yaml
|
240
245
|
- etc/init/logstash
|
@@ -249,6 +254,7 @@ files:
|
|
249
254
|
- etc/redhat/logstash
|
250
255
|
- etc/redhat/logstash.spec
|
251
256
|
- etc/logstash-stomp-input.yaml
|
257
|
+
- etc/subscriber-amqp.conf
|
252
258
|
- etc/logstash-elasticsearch-rabbitmq-river.yaml
|
253
259
|
- patterns/ruby
|
254
260
|
- patterns/nagios
|