logstash-filter-varnishlog 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/filters/varnishlog.rb +21 -7
- data/logstash-filter-varnishlog.gemspec +1 -1
- 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: e1d5430d9891df7eb05a936e6ea8907bfd538491
|
4
|
+
data.tar.gz: 7c73df4fdfda351524e23f4fc9b3b05e369d63b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890fc12eb2d59be5950e5b2e5fc6df51adbd20ce4cafc0d4283ba8ab88a36abbc722366585b2ba04e0d6efd842aff86934aaf82612283bccd006fe83de517fb6
|
7
|
+
data.tar.gz: e4a20a07ae22ebe61cc6dc17bac9acc51867dac7c17436d848147bb234e910a815d6ca5cb2edd3cd0aed42836e53cd6ee7455f1d89ea8306a200fc98763815a9
|
@@ -40,9 +40,13 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base
|
|
40
40
|
end
|
41
41
|
## VCL Log
|
42
42
|
vcl_log = items.grep(/VCL_Log/)
|
43
|
-
|
43
|
+
log_lines = []
|
44
|
+
vcl_log.each_with_index do |log, index|
|
44
45
|
if match = /-\s+VCL_Log\s+(?<log_line>.*)/.match(log)
|
45
|
-
|
46
|
+
log_lines.push(match['log_line'])
|
47
|
+
event.set("[VCL_Log][#{index}]", log_lines)
|
48
|
+
end
|
49
|
+
if index == log_lines.size - 1
|
46
50
|
event.set("VCL_Log", log_lines)
|
47
51
|
end
|
48
52
|
end
|
@@ -81,15 +85,25 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base
|
|
81
85
|
event.set("RespProtocol", protocol_match['protocol'])
|
82
86
|
end
|
83
87
|
## Match RespStatus
|
84
|
-
|
85
|
-
|
88
|
+
status_match = items.grep(/RespStatus/)
|
89
|
+
states = []
|
90
|
+
status_match.each_with_index do |status, index|
|
91
|
+
if match = /-\s+RespStatus\s+(?<status>.*)/.match(status)
|
92
|
+
states.push(match['status'].to_i)
|
93
|
+
end
|
94
|
+
if index == status_match.size - 1
|
95
|
+
event.set("RespStatus", states)
|
96
|
+
end
|
86
97
|
end
|
87
98
|
## Match RespReason
|
88
99
|
response_reason = items.grep(/RespReason/)
|
89
|
-
|
100
|
+
reasons = []
|
101
|
+
response_reason.each_with_index do |reason, index|
|
90
102
|
if match = /-\s+RespReason\s+(?<reason>.*)/.match(reason)
|
91
|
-
|
92
|
-
|
103
|
+
reasons.push(match['reason'])
|
104
|
+
end
|
105
|
+
if index == response_reason.size - 1
|
106
|
+
event.set("RespReason", reasons)
|
93
107
|
end
|
94
108
|
end
|
95
109
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-varnishlog'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.2'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = 'A logstash plugin reading varnishlog output'
|
6
6
|
s.description = 'logstash filter plugin reading varnishlog grouped by id'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-varnishlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Herweg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|