logstash-filter-varnishlog 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/logstash/filters/varnishlog.rb +13 -1
- 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: e0acfb4d454fbb5080fd7f2cbb839e8a9784572e
|
4
|
+
data.tar.gz: e2ca62597cf53a52a293094a6c11a77d7b0fb13c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd086fac99e01cc90fd6683a83d55c50bf3d3e8df2f71bf2becf6b12890b7c5baddf57b6494bed55a36b4817dcbeee028621aaa5ecf00d44e70ae56bacf1251f
|
7
|
+
data.tar.gz: dabe7c7ce47bd0495037c998da197c2a3c43e6af94cabf45f66c1400b1740ccc8396b09c872dafee9f776cd1123d59d829d8cc669ed092dd707dcd65427a5ff9
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ require "logstash/namespace"
|
|
6
6
|
# message field with whatever you specify in the configuration.
|
7
7
|
#
|
8
8
|
# It is only intended to be used as an .
|
9
|
+
|
10
|
+
##Extenting array class to to an something like grep -v
|
11
|
+
class Array
|
12
|
+
def grepv(regex, &block)
|
13
|
+
self.reject { |elem| elem =~ regex }.each(&block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
9
17
|
class LogStash::Filters::Varnishlog < LogStash::Filters::Base
|
10
18
|
|
11
19
|
# Setting the config_name here is required. This is how you
|
@@ -21,7 +29,7 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base
|
|
21
29
|
|
22
30
|
# Replace the message with this value.
|
23
31
|
#config :message, :validate => :string, :default => "Hello World!"
|
24
|
-
|
32
|
+
config :blacklist_sections, :validate => :array, :default => []
|
25
33
|
|
26
34
|
public
|
27
35
|
def register
|
@@ -31,6 +39,10 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base
|
|
31
39
|
public
|
32
40
|
def filter(event)
|
33
41
|
items = event.get("[message]").split("\n")
|
42
|
+
##Remove Blacklisted items from items hash
|
43
|
+
items = items.grepv(/(#{blacklist_sections.join("|")})/) if blacklist_sections.any?
|
44
|
+
##
|
45
|
+
|
34
46
|
##timestamps
|
35
47
|
timestamps = items.grep(/Timestamp/)
|
36
48
|
timestamps.each do |timestamp|
|
@@ -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.5'
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Herweg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|