logstash-filter-grok 0.1.8 → 0.1.9

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: f7bdd66921abfd6b315406d9646bf422d944ce63
4
- data.tar.gz: 5fcc15b5a0beeb2b3bb29c4fcaeea49c6adaf9bf
3
+ metadata.gz: 6f88ce234ed639c0da01571812b00fc9543a8772
4
+ data.tar.gz: 2a069fa37ca5bcffee14c6349d7882b24290128f
5
5
  SHA512:
6
- metadata.gz: 7e232e8db6f7b719fc4e99254a9cc4eec67f3edbc36e024911febdeb27d424532c4b69e8ff8ac300ac8c752ac08750bd2adf8f70024c1d4ba2a1e6f8859f50d8
7
- data.tar.gz: 56be51887cb1716fdbd15dbdf5d10f0363cd137961091425a9c9d8c6b2d01a074711ef2faeb6518007e88ecf31666013113b5396cc85e94322966aa42cd4be7f
6
+ metadata.gz: df2a9ecc781c10ffa3332359c6814ebb7ddb6639c8615fd9aefbd391f000fd35746c7fcd5d72a2bacb40042d3db3a6443a9354cb613c9ba44fcbfec3b40ee37b
7
+ data.tar.gz: 9dcda55048faf8df0d3a53bf491b553af7c3e232071eb36a02c9eee12e9378ccd74a00da6aaced7895f5d780e61782dd393ed6816097ac61b1523abe83c63491
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2015 Elasticsearch <http://www.elasticsearch.org>
1
+ Copyright (c) 20122015 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -1,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-grok'
4
- s.version = '0.1.8'
4
+ s.version = '0.1.9'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Parse arbitrary text and structure it."
7
7
  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"
8
- s.authors = ["Elasticsearch"]
9
- s.email = 'info@elasticsearch.com'
10
- s.homepage = "http://www.elasticsearch.org/guide/en/logstash/current/index.html"
8
+ s.authors = ["Elastic"]
9
+ s.email = 'info@elastic.co'
10
+ s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
@@ -702,4 +702,66 @@ describe LogStash::Filters::Grok do
702
702
  end
703
703
  end
704
704
 
705
+ describe "grok with nil coerced value" do
706
+ config <<-CONFIG
707
+ filter {
708
+ grok {
709
+ match => { "message" => "test (N/A|%{BASE10NUM:duration:float}ms)" }
710
+ }
711
+ }
712
+ CONFIG
713
+
714
+ sample "test 28.4ms" do
715
+ insist { subject["duration"] } == 28.4
716
+ insist { subject["tags"] }.nil?
717
+ end
718
+
719
+ sample "test N/A" do
720
+ insist { insist { subject.to_hash }.include?("duration") }.fails
721
+ insist { subject["tags"] }.nil?
722
+ end
723
+
724
+ sample "test abc" do
725
+ insist { subject["duration"] }.nil?
726
+ insist { subject["tags"] } == ["_grokparsefailure"]
727
+ end
728
+ end
729
+
730
+ describe "grok with nil coerced value and keep_empty_captures" do
731
+ config <<-CONFIG
732
+ filter {
733
+ grok {
734
+ match => { "message" => "test (N/A|%{BASE10NUM:duration:float}ms)" }
735
+ keep_empty_captures => true
736
+ }
737
+ }
738
+ CONFIG
739
+
740
+ sample "test N/A" do
741
+ insist { subject.to_hash }.include?("duration")
742
+ insist { subject["tags"] }.nil?
743
+ end
744
+
745
+ end
746
+
747
+ describe "grok with no coercion" do
748
+ config <<-CONFIG
749
+ filter {
750
+ grok {
751
+ match => { "message" => "test (N/A|%{BASE10NUM:duration}ms)" }
752
+ }
753
+ }
754
+ CONFIG
755
+
756
+ sample "test 28.4ms" do
757
+ insist { subject["duration"] } == "28.4"
758
+ insist { subject["tags"] }.nil?
759
+ end
760
+
761
+ sample "test N/A" do
762
+ insist { subject["duration"] }.nil?
763
+ insist { subject["tags"] }.nil?
764
+ end
765
+ end
766
+
705
767
  end
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-grok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
- - Elasticsearch
7
+ - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-03 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash-core
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - '>='
18
17
  - !ruby/object:Gem::Version
@@ -20,7 +19,10 @@ dependencies:
20
19
  - - <
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.0.0
23
- requirement: !ruby/object:Gem::Requirement
22
+ name: logstash-core
23
+ prerelease: false
24
+ type: :runtime
25
+ version_requirements: !ruby/object:Gem::Requirement
24
26
  requirements:
25
27
  - - '>='
26
28
  - !ruby/object:Gem::Version
@@ -28,52 +30,50 @@ dependencies:
28
30
  - - <
29
31
  - !ruby/object:Gem::Version
30
32
  version: 2.0.0
31
- prerelease: false
32
- type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
- name: jls-grok
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ~>
38
- - !ruby/object:Gem::Version
39
- version: 0.11.1
40
34
  requirement: !ruby/object:Gem::Requirement
41
35
  requirements:
42
36
  - - ~>
43
37
  - !ruby/object:Gem::Version
44
38
  version: 0.11.1
39
+ name: jls-grok
45
40
  prerelease: false
46
41
  type: :runtime
47
- - !ruby/object:Gem::Dependency
48
- name: logstash-patterns-core
49
42
  version_requirements: !ruby/object:Gem::Requirement
50
43
  requirements:
51
- - - '>='
44
+ - - ~>
52
45
  - !ruby/object:Gem::Version
53
- version: '0'
46
+ version: 0.11.1
47
+ - !ruby/object:Gem::Dependency
54
48
  requirement: !ruby/object:Gem::Requirement
55
49
  requirements:
56
50
  - - '>='
57
51
  - !ruby/object:Gem::Version
58
52
  version: '0'
53
+ name: logstash-patterns-core
59
54
  prerelease: false
60
55
  type: :runtime
61
- - !ruby/object:Gem::Dependency
62
- name: logstash-devutils
63
56
  version_requirements: !ruby/object:Gem::Requirement
64
57
  requirements:
65
58
  - - '>='
66
59
  - !ruby/object:Gem::Version
67
60
  version: '0'
61
+ - !ruby/object:Gem::Dependency
68
62
  requirement: !ruby/object:Gem::Requirement
69
63
  requirements:
70
64
  - - '>='
71
65
  - !ruby/object:Gem::Version
72
66
  version: '0'
67
+ name: logstash-devutils
73
68
  prerelease: false
74
69
  type: :development
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
75
  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
76
- email: info@elasticsearch.com
76
+ email: info@elastic.co
77
77
  executables: []
78
78
  extensions: []
79
79
  extra_rdoc_files: []
@@ -87,7 +87,7 @@ files:
87
87
  - lib/logstash/filters/grok.rb
88
88
  - logstash-filter-grok.gemspec
89
89
  - spec/filters/grok_spec.rb
90
- homepage: http://www.elasticsearch.org/guide/en/logstash/current/index.html
90
+ homepage: http://www.elastic.co/guide/en/logstash/current/index.html
91
91
  licenses:
92
92
  - Apache License (2.0)
93
93
  metadata: