logstash-filter-mutate 0.1.3 → 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/Gemfile +1 -2
- data/README.md +12 -21
- data/lib/logstash/filters/mutate.rb +2 -3
- data/logstash-filter-mutate.gemspec +2 -2
- data/spec/filters/mutate_spec.rb +13 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e786838d1652670bfe1c5d2a6709e6daccb9d8a
|
4
|
+
data.tar.gz: 33960819977d2d9e8a23efbb32a77eb50e5c2f51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2728eefcd0e685c3f9181e548c564bd16df6c3a80901778aadaeed1c0ee28a9c53234defe7c5a5e18dc1ceef5f809e287155f8f356a69da3b353ed0650e45d20
|
7
|
+
data.tar.gz: 4da85c0b38cab1c81b5c1d233f9d2d259903d3f626f221f82763b7d90e066c9db300b1125148d001d1434a5b96158fd0d72b5a3ef08738f51d48e3046dd3d498
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com
|
|
22
22
|
#### Code
|
23
23
|
- To get started, you'll need JRuby with the Bundler gem installed.
|
24
24
|
|
25
|
-
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization.
|
25
|
+
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
|
26
26
|
|
27
27
|
- Install dependencies
|
28
28
|
```sh
|
@@ -31,26 +31,15 @@ bundle install
|
|
31
31
|
|
32
32
|
#### Test
|
33
33
|
|
34
|
-
|
35
|
-
bundle exec rspec
|
36
|
-
```
|
34
|
+
- Update your dependencies
|
37
35
|
|
38
|
-
|
39
|
-
|
40
|
-
gem "logstash", :github => "elasticsearch/logstash", :branch => "1.5"
|
41
|
-
```
|
42
|
-
To test against another version or a local Logstash, edit the `Gemfile` to specify an alternative location, for example:
|
43
|
-
```ruby
|
44
|
-
gem "logstash", :github => "elasticsearch/logstash", :ref => "master"
|
45
|
-
```
|
46
|
-
```ruby
|
47
|
-
gem "logstash", :path => "/your/local/logstash"
|
36
|
+
```sh
|
37
|
+
bundle install
|
48
38
|
```
|
49
39
|
|
50
|
-
|
40
|
+
- Run tests
|
51
41
|
|
52
42
|
```sh
|
53
|
-
bundle install
|
54
43
|
bundle exec rspec
|
55
44
|
```
|
56
45
|
|
@@ -58,13 +47,13 @@ bundle exec rspec
|
|
58
47
|
|
59
48
|
#### 2.1 Run in a local Logstash clone
|
60
49
|
|
61
|
-
- Edit Logstash `
|
50
|
+
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
62
51
|
```ruby
|
63
52
|
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
64
53
|
```
|
65
|
-
-
|
54
|
+
- Install plugin
|
66
55
|
```sh
|
67
|
-
|
56
|
+
bin/plugin install --no-verify
|
68
57
|
```
|
69
58
|
- Run Logstash with your plugin
|
70
59
|
```sh
|
@@ -74,6 +63,8 @@ At this point any modifications to the plugin code will be applied to this local
|
|
74
63
|
|
75
64
|
#### 2.2 Run in an installed Logstash
|
76
65
|
|
66
|
+
You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
|
67
|
+
|
77
68
|
- Build your plugin gem
|
78
69
|
```sh
|
79
70
|
gem build logstash-filter-awesome.gemspec
|
@@ -90,6 +81,6 @@ All contributions are welcome: ideas, patches, documentation, bug reports, compl
|
|
90
81
|
|
91
82
|
Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
|
92
83
|
|
93
|
-
It is more important to
|
84
|
+
It is more important to the community that you are able to contribute.
|
94
85
|
|
95
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
86
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -89,9 +89,8 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
|
|
89
89
|
# gsub => [
|
90
90
|
# # replace all forward slashes with underscore
|
91
91
|
# "fieldname", "/", "_",
|
92
|
-
#
|
93
|
-
# #
|
94
|
-
# # dot
|
92
|
+
# # replace backslashes, question marks, hashes, and minuses
|
93
|
+
# # with a dot "."
|
95
94
|
# "fieldname2", "[\\?#-]", "."
|
96
95
|
# ]
|
97
96
|
# }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-mutate'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.5'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "The mutate filter allows you to perform general mutations on fields. You can rename, remove, replace, and modify fields in your events."
|
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"
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency
|
23
|
+
s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
|
24
24
|
s.add_runtime_dependency 'logstash-patterns-core'
|
25
25
|
s.add_runtime_dependency 'logstash-filter-grok'
|
26
26
|
s.add_development_dependency 'logstash-devutils'
|
data/spec/filters/mutate_spec.rb
CHANGED
@@ -160,6 +160,19 @@ describe LogStash::Filters::Mutate do
|
|
160
160
|
end
|
161
161
|
end
|
162
162
|
|
163
|
+
describe "gsub on regular expression" do
|
164
|
+
config '
|
165
|
+
filter {
|
166
|
+
mutate {
|
167
|
+
gsub => [ "colors", "\d$", "blue"]
|
168
|
+
}
|
169
|
+
}'
|
170
|
+
|
171
|
+
sample("colors" => "red3") do
|
172
|
+
insist { subject["colors"] } == "redblue"
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
163
176
|
describe "regression - mutate should lowercase a field created by grok" do
|
164
177
|
config <<-CONFIG
|
165
178
|
filter {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-mutate
|
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
|
- Elasticsearch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
- - <
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 2.0.0
|
22
|
-
name: logstash
|
22
|
+
name: logstash-core
|
23
23
|
prerelease: false
|
24
24
|
type: :runtime
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.4.5
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: The mutate filter allows you to perform general mutations on fields. You can rename, remove, replace, and modify fields in your events.
|