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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b61a3c282504f137dcb92d215085e4d7a59f2620
4
- data.tar.gz: 65efb5bab08fac6b14d997c45ebd12df6743a4f2
3
+ metadata.gz: e0acfb4d454fbb5080fd7f2cbb839e8a9784572e
4
+ data.tar.gz: e2ca62597cf53a52a293094a6c11a77d7b0fb13c
5
5
  SHA512:
6
- metadata.gz: 220d4d17fad78f5611743d9bbaff6b02b9df7bc632233aa67c1bd2d626ab2edd2aed8813eb4f51f17a4adf87250a1f5ca4594647212418590b80dcde29cc48b1
7
- data.tar.gz: 9234ca0f4a561405d2691b52010ff4bf09f3b4683e38bc94b14b3c508c0cdd117cadf89903d931adba21afd10e8f1ebd36df18e4418b5ccd62be2a76b9f56a3c
6
+ metadata.gz: dd086fac99e01cc90fd6683a83d55c50bf3d3e8df2f71bf2becf6b12890b7c5baddf57b6494bed55a36b4817dcbeee028621aaa5ecf00d44e70ae56bacf1251f
7
+ data.tar.gz: dabe7c7ce47bd0495037c998da197c2a3c43e6af94cabf45f66c1400b1740ccc8396b09c872dafee9f776cd1123d59d829d8cc669ed092dd707dcd65427a5ff9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## 0.1.5
2
+ - config to remove blacklisted items from items hash
1
3
  ## 0.1.4
2
4
  - Fix VCL_LOG discovery
3
5
  ## 0.1.0
@@ -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.4'
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
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-02-22 00:00:00.000000000 Z
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