logstash-input-acquia 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +29 -0
- data/lib/logstash/inputs/acquia.rb +18 -3
- data/lib/logstash/inputs/acquia/version.rb +7 -0
- data/logstash-input-acquia.gemspec +4 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf2af58162eb4692f33361b43f54e8849bed8bc8
|
4
|
+
data.tar.gz: b349c5c34610606663d7197525fc30b026be39ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b137ea299ffb05121af07f209729f9d644a1b24747ebfa2ab47b892aff7693df79bdb9a4e5e0ceaff2b1794b14b4fb5bf88040ff609d7cf79e4c858c814a87b
|
7
|
+
data.tar.gz: 28f5c4382d72814667920254fe6cff7035ab621d1ed457e47e6b2f2c42c1ebd7cf1536cb2ce5bab380539a4431e934e6a9426206dd58a4deb0753968cd7eee02
|
data/Rakefile
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
$:.push File.join(File.dirname(__FILE__), 'lib')
|
2
|
+
|
3
|
+
require 'logstash/inputs/acquia/version'
|
4
|
+
|
5
|
+
def current_gems
|
6
|
+
Dir["pkg/logstash-input-acquia-*.gem"]
|
7
|
+
end
|
8
|
+
|
9
|
+
namespace :gem do
|
10
|
+
desc 'Build gem'
|
11
|
+
task :build do
|
12
|
+
mkdir 'pkg' unless File.exist? 'pkg'
|
13
|
+
sh *%w{gem build logstash-input-acquia.gemspec}
|
14
|
+
Dir['*.gem'].each do |gem|
|
15
|
+
mv gem, "pkg/#{gem}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'Deploy gems to rubygems'
|
20
|
+
task :deploy => ['gem:build'] do
|
21
|
+
current_gems.each do |gem|
|
22
|
+
sh *%W{gem push #{gem}}
|
23
|
+
end
|
24
|
+
if File.exist? '.git'
|
25
|
+
sh *%W{git tag #{LogStash::Inputs::Acquia::VERSION}}
|
26
|
+
sh *%W{git push origin tag #{LogStash::Inputs::Acquia::VERSION}}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -37,7 +37,7 @@ class LogStash::Inputs::Acquia < LogStash::Inputs::Base
|
|
37
37
|
@streams.each do |env, stream|
|
38
38
|
stream.each_log do |log|
|
39
39
|
# p log
|
40
|
-
queue << generate_event(env, log)
|
40
|
+
queue << decorate(generate_event(env, log))
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -52,16 +52,19 @@ class LogStash::Inputs::Acquia < LogStash::Inputs::Base
|
|
52
52
|
|
53
53
|
private
|
54
54
|
def generate_event(env, log)
|
55
|
-
# Remove useless cruft.
|
55
|
+
# Remove useless API cruft.
|
56
56
|
log.delete 'cmd'
|
57
|
+
|
57
58
|
# Save the environment this message is coming from.
|
58
59
|
log['acquia'] = {
|
59
60
|
'site' => @site.name,
|
60
61
|
'environment' => env,
|
61
62
|
}
|
63
|
+
|
62
64
|
# Rename some of Acquia's parameters to more relevant Logstash names.
|
63
65
|
log['host'] = log.delete('server')
|
64
66
|
log['message'] = log.delete('text')
|
67
|
+
|
65
68
|
# Trim off duplicated request id if Acquia has already provided it
|
66
69
|
# separately.
|
67
70
|
if log['request_id']
|
@@ -71,8 +74,20 @@ class LogStash::Inputs::Acquia < LogStash::Inputs::Base
|
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
74
|
-
|
77
|
+
timestamp = log.delete('disp_time')
|
78
|
+
if timestamp
|
79
|
+
begin
|
80
|
+
log['@timestamp'] = Time.parse(timestamp + ' +0000').iso8601
|
81
|
+
rescue ArgumentError
|
82
|
+
# Not a valid timestamp. Oh well. Clean up, just in case.
|
83
|
+
log.delete '@timestamp'
|
84
|
+
end
|
85
|
+
end
|
75
86
|
|
76
87
|
LogStash::Event.new(log)
|
77
88
|
end
|
78
89
|
end
|
90
|
+
|
91
|
+
# Required afterwards so that the inheritance tree has already been built
|
92
|
+
# correctly.
|
93
|
+
require 'logstash/inputs/acquia/version'
|
@@ -1,7 +1,10 @@
|
|
1
|
+
$:.push File.join(File.dirname(__FILE__), 'lib')
|
2
|
+
|
3
|
+
require 'logstash/inputs/acquia/version'
|
1
4
|
|
2
5
|
Gem::Specification.new do |s|
|
3
6
|
s.name = 'logstash-input-acquia'
|
4
|
-
s.version =
|
7
|
+
s.version = LogStash::Inputs::Acquia::VERSION
|
5
8
|
s.licenses = ['MIT']
|
6
9
|
s.summary = 'Logstash Input plugin that streams logs from Acquia Cloud'
|
7
10
|
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'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-acquia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Equiem
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- LICENSE
|
99
99
|
- Rakefile
|
100
100
|
- lib/logstash/inputs/acquia.rb
|
101
|
+
- lib/logstash/inputs/acquia/version.rb
|
101
102
|
- logstash-input-acquia.gemspec
|
102
103
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
103
104
|
licenses:
|