logstash-input-acquia 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/inputs/acquia.rb +12 -7
- data/logstash-input-acquia.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d1b41c923d3c2488a45aa8c0550fb13528c4133
|
4
|
+
data.tar.gz: 75f231cc490879d6cbe3992e16329e610f2658ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 001cce6e944a33dae032d8b3c52b8b15a1089e4853c2490269f5af62958761dd54d469a0fb7f54c63b73d07333e07847b6cc822e022af8d0613789e5ba94502c
|
7
|
+
data.tar.gz: db4160c507a28839f4d43cc4818687a626f84c90f1539bff7dbe436c2e4c7d959474efc9e6e528dbb285eb4c77bd8d44221d7928058f88ec866645b522c075aa
|
@@ -20,23 +20,24 @@ class LogStash::Inputs::Acquia < LogStash::Inputs::Base
|
|
20
20
|
def register
|
21
21
|
@cloud = ::Acquia::Cloud.new(:credentials => "#{@username}:#{@api_key}")
|
22
22
|
@site = @cloud.site(@site)
|
23
|
-
@streams =
|
23
|
+
@streams = {}
|
24
|
+
@environments.each do |env|
|
24
25
|
@logger.info "Opening log stream for #{env}."
|
25
26
|
stream = @site.environment(env).logstream
|
26
27
|
@types.each do |type|
|
27
28
|
stream.enable_type type
|
28
29
|
end
|
29
30
|
stream.connect
|
30
|
-
stream
|
31
|
+
@streams[env] = stream
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
34
35
|
def run(queue)
|
35
36
|
Stud.interval(1) do
|
36
|
-
@streams.each do |env|
|
37
|
-
|
37
|
+
@streams.each do |env, stream|
|
38
|
+
stream.each_log do |log|
|
38
39
|
# p log
|
39
|
-
queue << generate_event(log)
|
40
|
+
queue << generate_event(env, log)
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
@@ -50,13 +51,17 @@ class LogStash::Inputs::Acquia < LogStash::Inputs::Base
|
|
50
51
|
end
|
51
52
|
|
52
53
|
private
|
53
|
-
def generate_event(log)
|
54
|
+
def generate_event(env, log)
|
54
55
|
# Remove useless cruft.
|
55
56
|
log.delete 'cmd'
|
56
|
-
#
|
57
|
+
# Save the environment this message is coming from.
|
58
|
+
log['[acquia][site]'] = @site.name
|
59
|
+
log['[acquia][environment]'] = env
|
60
|
+
# Rename some of Acquia's parameters to more relevant Logstash names.
|
57
61
|
log['host'] = log.delete('server')
|
58
62
|
log['message'] = log.delete('text')
|
59
63
|
log['@timestamp'] = Time.parse(log.delete('disp_time') + ' +0000').iso8601
|
64
|
+
|
60
65
|
LogStash::Event.new(log)
|
61
66
|
end
|
62
67
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'logstash-input-acquia'
|
4
|
-
s.version = '1.
|
4
|
+
s.version = '1.1.0'
|
5
5
|
s.licenses = ['MIT']
|
6
6
|
s.summary = 'Logstash Input plugin that streams logs from Acquia Cloud'
|
7
7
|
s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program'
|