logstash-filter-de_dot 0.1.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19d3dbdf0af88b2fc0f7cb6a4b194fbd0e423b96
4
- data.tar.gz: 6c452fbe4d7395de2bc15686230e404a78a8f165
3
+ metadata.gz: 6c9fbb0c46943be7a2e1c806ae826e04af455df6
4
+ data.tar.gz: 65ffbc5f47614653cbe0e5af09621f43c961df8d
5
5
  SHA512:
6
- metadata.gz: 77df289bbb1999bac070e05388c26293a740830fb07784fe10251711117bcf45652cce662376b76b4f89195b7b8ac462a19f6a5b15dc2595ec367c90878459b7
7
- data.tar.gz: 07ef50f0e4fcd61a2acd5b5b54e7962751c590a6cd285a3f4ac702f648d148395803a5179726c57dd4eaa5fd7435a990ef40ebc80f73992547b6f6466270f08d
6
+ metadata.gz: 4eb5e878e39c2308be6a8e7a8f7d2a6d6e8cec8af0230f15fa6cd11645654fc5a03064ee1fc77ba234ef81c4290711396e184d51ec1b1757c576c6f12f18c74d
7
+ data.tar.gz: 57c92a6cb4abab5fef4bf44d92b2141312483853991d836975c07fc62fc85c861b4fcd666c364a73e6f33d3910bce15a5be190792d7d5e5bf24ea534e76154eb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.0.0
2
+ - Depend on the correct version of logstash-core-plugin-api to work with
3
+ Logstash 5.0
4
+ - Fix all event references to use event.get() and event.set() methodology
1
5
  # 0.1.3
2
6
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
7
  # 0.1.2
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 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.
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Build
4
- Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-example-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-example-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-de_dot.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-de_dot)
5
4
 
6
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
7
6
 
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
56
55
  ```
57
56
  - Install plugin
58
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
59
62
  bin/plugin install --no-verify
63
+
60
64
  ```
61
65
  - Run Logstash with your plugin
62
66
  ```sh
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
74
78
  ```
75
79
  - Install the plugin from the Logstash home
76
80
  ```sh
77
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
78
87
  ```
79
88
  - Start Logstash and proceed to test the plugin
80
89
 
@@ -71,7 +71,7 @@ class LogStash::Filters::De_dot < LogStash::Filters::Base
71
71
  @logger.debug? && @logger.debug("de_dot: source field reference", :fieldref => fieldref)
72
72
  newref = fieldref.gsub('.', @separator)
73
73
  @logger.debug? && @logger.debug("de_dot: replacement field reference", :newref => newref)
74
- event[newref] = event[fieldref]
74
+ event.set(newref, event.get(fieldref))
75
75
  @logger.debug? && @logger.debug("de_dot: event with both new and old field references", :event => event.to_hash.to_s)
76
76
  event.remove(find_fieldref_for_delete(fieldref))
77
77
  @logger.debug? && @logger.debug("de_dot: postprocess", :event => event.to_hash.to_s)
@@ -88,7 +88,7 @@ class LogStash::Filters::De_dot < LogStash::Filters::Base
88
88
  end
89
89
  @logger.debug? && @logger.debug("de_dot: Act on these fields", :fields => fields)
90
90
  fields.each do |ref|
91
- if event[ref]
91
+ if event.get(ref)
92
92
  rename_field(event, ref) if has_dot?(ref)
93
93
  end
94
94
  end
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-de_dot'
3
- s.version = '0.1.3'
3
+ s.version = '1.0.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "This filter removes dots from field names and replaces them with a different separator."
6
- 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"
6
+ s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
7
7
  s.authors = ["Elastic"]
8
8
  s.email = 'info@elastic.co'
9
9
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
19
19
 
20
20
  # Gem dependencies
21
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
21
+ s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
22
22
  s.add_development_dependency 'logstash-devutils'
23
23
  end
@@ -26,7 +26,7 @@ describe LogStash::Filters::De_dot do
26
26
  it "should replace a dot with an underscore" do
27
27
  subject.filter(event)
28
28
  expect(event.to_hash.keys).not_to include('foo.bar')
29
- expect(event['foo_bar']).to eq('pass')
29
+ expect(event.get('foo_bar')).to eq('pass')
30
30
  end
31
31
  end
32
32
 
@@ -37,7 +37,7 @@ describe LogStash::Filters::De_dot do
37
37
  it "should replace a dot with an underscore" do
38
38
  subject.filter(event)
39
39
  expect(event.to_hash.keys).not_to include('foo.bar')
40
- expect(event['foo___bar']).to eq('pass')
40
+ expect(event.get('foo___bar')).to eq('pass')
41
41
  end
42
42
  end
43
43
 
@@ -47,13 +47,13 @@ describe LogStash::Filters::De_dot do
47
47
  it "should replace all dots with underscores" do
48
48
  subject.filter(event)
49
49
  expect(event.to_hash.keys).not_to include('acme.roller.skates')
50
- expect(event['acme_roller_skates']).to eq('coyote')
50
+ expect(event.get('acme_roller_skates')).to eq('coyote')
51
51
  end
52
52
 
53
53
  it "should not change a field without dots" do
54
54
  subject.filter(event)
55
55
  expect(event.to_hash.keys).to include('nodot')
56
- expect(event['nodot']).to eq('nochange')
56
+ expect(event.get('nodot')).to eq('nochange')
57
57
  end
58
58
  end
59
59
 
@@ -63,13 +63,13 @@ describe LogStash::Filters::De_dot do
63
63
  it "should replace all dots with underscores" do
64
64
  subject.filter(event)
65
65
  expect(event.to_hash.keys).not_to include('acme_roller.skates')
66
- expect(event['acme_roller_skates']).to eq('coyote')
66
+ expect(event.get('acme_roller_skates')).to eq('coyote')
67
67
  end
68
68
 
69
69
  it "should not change a field without dots" do
70
70
  subject.filter(event)
71
71
  expect(event.to_hash.keys).to include('no_dot')
72
- expect(event['no_dot']).to eq('nochange')
72
+ expect(event.get('no_dot')).to eq('nochange')
73
73
  end
74
74
  end
75
75
 
@@ -80,13 +80,13 @@ describe LogStash::Filters::De_dot do
80
80
  it "should convert dotted fields to sub-fields" do
81
81
  subject.filter(event)
82
82
  expect(event.to_hash.keys).not_to include('acme.roller.skates')
83
- expect(event['[acme][roller][skates]']).to eq('coyote')
83
+ expect(event.get('[acme][roller][skates]')).to eq('coyote')
84
84
  end
85
85
 
86
86
  it "should not change a field without dots" do
87
87
  subject.filter(event)
88
88
  expect(event.to_hash.keys).to include('nodot')
89
- expect(event['nodot']).to eq('nochange')
89
+ expect(event.get('nodot')).to eq('nochange')
90
90
  end
91
91
  end
92
92
 
@@ -96,14 +96,14 @@ describe LogStash::Filters::De_dot do
96
96
 
97
97
  it "should replace all dots with underscores within specified fields" do
98
98
  subject.filter(event)
99
- expect(event['acme']).not_to include('roller.skates')
100
- expect(event['[acme][roller_skates]']).to eq('coyote')
99
+ expect(event.get('acme')).not_to include('roller.skates')
100
+ expect(event.get('[acme][roller_skates]')).to eq('coyote')
101
101
  end
102
102
 
103
103
  it "should not change a field not listed, even with dots" do
104
104
  subject.filter(event)
105
105
  expect(event.to_hash.keys).to include('foo.bar')
106
- expect(event['foo.bar']).to eq('nochange')
106
+ expect(event.get('foo.bar')).to eq('nochange')
107
107
  end
108
108
  end
109
109
 
@@ -124,12 +124,12 @@ describe LogStash::Filters::De_dot do
124
124
 
125
125
  it "should replace all dots with underscores within specified fields" do
126
126
  subject.filter(event)
127
- expect(event['acme']).not_to include('roller.skates')
128
- expect(event['[acme][roller][skates]']).to eq('coyote')
127
+ expect(event.get('acme')).not_to include('roller.skates')
128
+ expect(event.get('[acme][roller][skates]')).to eq('coyote')
129
129
  expect(event.to_hash.keys).not_to include('foo.bar')
130
- expect(event['[foo][bar]']).to eq('nochange')
130
+ expect(event.get('[foo][bar]')).to eq('nochange')
131
131
  expect(event.to_hash.keys).not_to include('a.b')
132
- expect(event['[a][b][c][d][e][f]']).to eq('finally')
132
+ expect(event.get('[a][b][c][d][e][f]')).to eq('finally')
133
133
  end
134
134
  end
135
135
 
@@ -149,10 +149,10 @@ describe LogStash::Filters::De_dot do
149
149
 
150
150
  it "should replace all dots with underscores within specified fields" do
151
151
  subject.filter(event)
152
- expect(event['acme']).not_to include('roller.skates')
153
- expect(event['[acme][roller][skates]']).to eq('coyote')
152
+ expect(event.get('acme')).not_to include('roller.skates')
153
+ expect(event.get('[acme][roller][skates]')).to eq('coyote')
154
154
  expect(event.to_hash.keys).not_to include('a.b')
155
- expect(event['[a][b][c][d][e][f]']).to eq('finally')
155
+ expect(event.get('[a][b][c][d][e][f]')).to eq('finally')
156
156
  end
157
157
 
158
158
  it "should not add [foo][bar]" do
@@ -177,14 +177,14 @@ describe LogStash::Filters::De_dot do
177
177
 
178
178
  it "should replace all dots with underscores" do
179
179
  subject.filter(event)
180
- expect(event["acme"]).not_to include('super.roller_skates')
181
- expect(event['[acme][super_roller_skates']).to eq('coyote')
180
+ expect(event.get('acme')).not_to include('super.roller_skates')
181
+ expect(event.get('[acme][super_roller_skates')).to eq('coyote')
182
182
  end
183
183
 
184
184
  it "should not change a field without dots" do
185
185
  subject.filter(event)
186
186
  expect(event.to_hash.keys).to include('field_with')
187
- expect(event['[field_with][no_dot]']).to eq('nochange')
187
+ expect(event.get('[field_with][no_dot]')).to eq('nochange')
188
188
  end
189
189
  end
190
190
 
@@ -204,14 +204,14 @@ describe LogStash::Filters::De_dot do
204
204
 
205
205
  it "should replace all dots with underscores" do
206
206
  subject.filter(event)
207
- expect(event["acme"]).not_to include('super.roller_skates')
208
- expect(event['[acme][super][roller_skates']).to eq('coyote')
207
+ expect(event.get('acme')).not_to include('super.roller_skates')
208
+ expect(event.get('[acme][super][roller_skates')).to eq('coyote')
209
209
  end
210
210
 
211
211
  it "should not change a field without dots" do
212
212
  subject.filter(event)
213
213
  expect(event.to_hash.keys).to include('field_with')
214
- expect(event['[field_with][no_dot]']).to eq('nochange')
214
+ expect(event.get('[field_with][no_dot]')).to eq('nochange')
215
215
  end
216
216
  end
217
217
 
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-de_dot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '1.60'
19
+ - - "<="
17
20
  - !ruby/object:Gem::Version
18
- version: '1.0'
21
+ version: '2.99'
19
22
  name: logstash-core-plugin-api
20
23
  prerelease: false
21
24
  type: :runtime
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.60'
30
+ - - "<="
25
31
  - !ruby/object:Gem::Version
26
- version: '1.0'
32
+ version: '2.99'
27
33
  - !ruby/object:Gem::Dependency
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
@@ -38,7 +44,7 @@ dependencies:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: '0'
41
- 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
47
+ description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
42
48
  email: info@elastic.co
43
49
  executables: []
44
50
  extensions: []