anschel 0.7.5 → 0.7.6

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: 6b6d4e7d557f68da980aaf5beb1e83ccbb9aa7c0
4
- data.tar.gz: 9c5a4022f0bb8001bfc177df472ad64fa3f0c115
3
+ metadata.gz: b86ab19c97440c7372ab1e1f60de4057af792aaf
4
+ data.tar.gz: 63db6a0a01d4c8ea686ea69ae882e9a4f8924dbe
5
5
  SHA512:
6
- metadata.gz: 64d31ed966942e4586532042a2c492582219e573787a2b2497fe9df5a16316320dbfefc2751e1246c4305277fbc38a56cba53da9d3c3542d4b1a51c65e3ff731
7
- data.tar.gz: a50e35b76c4351ce47bcfe24225395cb3b077529535345d73a158aa587dc1014696830a53b2c97a4c8e73d0e165d8d8dddd0d4df7fe7e0a6ed9c54c194cc5579
6
+ metadata.gz: 648dd43996a398c7ed2866dcae8caa04ed1e431b0b18a82cc196ef109b418c14fa0f76ca0411570a31713590fc0db5afcfee0b7eff82608a34a4e5539fc063a6
7
+ data.tar.gz: d7cdf5b6ccf2a570065cda3587523e093c4db063844ac493ae3e8f41c76cb1685f2ef0fade5212a745b12d7e5890e4cfdee8350f27abfacf725ee0c5f55ce35f
data/Readme.md CHANGED
@@ -172,6 +172,7 @@ You might deploy Anschel with Upstart. Here's a minimal config:
172
172
 
173
173
  _In development_
174
174
 
175
+ - Stability and usage improvements (v0.7)
175
176
  - Allow multiple input and output configurations (v0.6)
176
177
  - Support for RabbitMQ input (v0.5)
177
178
  - Support for file (device) output (v0.4)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.5
1
+ 0.7.6
@@ -9,7 +9,7 @@ module Anschel
9
9
  class Filter
10
10
  def gsub conf, stats, log
11
11
  field = conf.delete :field
12
- match = Regexp.new conf.delete(:match)
12
+ match = conf.delete :match
13
13
  replace = conf.delete :replace
14
14
 
15
15
  raise 'Missing required "field" for "gsub" filter' if field.nil?
@@ -18,6 +18,9 @@ module Anschel
18
18
 
19
19
  field = field.to_sym
20
20
 
21
+ match = match.is_a?(Array) ? match : [ match ]
22
+ match = match.map { |m| Regexp.new m }
23
+
21
24
  stats.create 'filter-gsub'
22
25
  stats.create 'filter-gsub-skipped'
23
26
 
@@ -27,12 +30,14 @@ module Anschel
27
30
 
28
31
 
29
32
  lambda do |event|
30
- unless event.has_key? field
33
+ unless event[field]
31
34
  stats.inc 'filter-gsub-skipped'
32
35
  return event
33
36
  end
34
37
 
35
- event[field].gsub! match, replace
38
+ match.each do |m|
39
+ event[field].gsub! m, replace
40
+ end
36
41
  stats.inc 'filter-gsub'
37
42
  filtered event, conf
38
43
  end
@@ -29,12 +29,12 @@ module Anschel
29
29
 
30
30
 
31
31
  lambda do |event|
32
- unless event.has_key? field
32
+ unless event[field]
33
33
  stats.inc 'filter-parse-skipped'
34
34
  return event
35
35
  end
36
36
 
37
- if event.has_key? unless_field
37
+ if event[unless_field]
38
38
  stats.inc 'filter-parse-skipped'
39
39
  return event
40
40
  end
@@ -33,7 +33,7 @@ module Anschel
33
33
 
34
34
 
35
35
  lambda do |event|
36
- unless event.has_key?(field) && event[field]
36
+ unless event[field]
37
37
  stats.inc 'filter-scan-skipped'
38
38
  return event
39
39
  end
@@ -47,12 +47,12 @@ module Anschel
47
47
 
48
48
 
49
49
  lambda do |event|
50
- unless event.has_key? field
50
+ unless event[field]
51
51
  stats.inc 'filter-stamp-skipped'
52
52
  return event
53
53
  end
54
54
 
55
- if event.has_key? target
55
+ if event[target]
56
56
  log.debug \
57
57
  event: 'stamp-filter-warning',
58
58
  reason: 'event already has target field',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anschel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2015-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement