fluent-plugin-mutate_filter 0.3.0 → 0.3.1
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 +4 -4
- data/README.md +1 -1
- data/fluent-plugin-mutate_filter.gemspec +2 -2
- data/lib/fluent/plugin/filter_mutate.rb +6 -2
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c5e97b05afb87f1d5b466ba464630f4d643861e
|
4
|
+
data.tar.gz: 69b17c8f7134faf9ac80edddf88174e064e63d80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21a198e9f7295e335563409132ed161017dc5a6fc9fb5e9a39b646390b45367613c8606513c3dc650761b01b72cb5a177222cebc95fb2fdcb420d6ce11b29309
|
7
|
+
data.tar.gz: 4edca7c0bde6bc600f431183d3f1707bd4914f3f8f37a3ca645d9175782c9fca5b6aac3ed00f8a8e4298020c7a6f37110da7235b18adb40e82c4865eca97a8dc
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Fluent::MutateFilter
|
2
2
|
|
3
|
-
This gem provides the `mutate` filter for Fluentd which is designed to replicate the way `mutate` works in Logstash as much as possible.
|
3
|
+
This gem provides the `mutate` filter for Fluentd which is designed to replicate the way `mutate` works in Logstash as much as possible.
|
4
4
|
|
5
5
|
To be honest, this is a translation of [logstash-filter-mutate](https://github.com/logstash-plugins/logstash-filter-mutate) bordering on copy-paste.
|
6
6
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "fluent-plugin-mutate_filter"
|
4
|
-
spec.version = "0.3.
|
4
|
+
spec.version = "0.3.1"
|
5
5
|
spec.authors = ["Jonathan Serafini"]
|
6
6
|
spec.email = ["jonathan@serafini.ca"]
|
7
7
|
spec.summary = %q{A mutate filter for Fluent which functions like Logstash.}
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.executables = []
|
13
13
|
spec.require_paths = ["lib"]
|
14
14
|
|
15
|
-
spec.add_runtime_dependency "fluentd", [">= 0.12.0"
|
15
|
+
spec.add_runtime_dependency "fluentd", [">= 0.12.0"]
|
16
16
|
spec.add_development_dependency "bundler", "~> 1.11"
|
17
17
|
spec.add_development_dependency "rake", "~> 10.0"
|
18
18
|
end
|
@@ -23,9 +23,11 @@ module Fluent
|
|
23
23
|
# - If the field does not exist then no action will be taken.
|
24
24
|
# - If the new value contains a placeholder %{}, then the value will be
|
25
25
|
# expanded to the related event record field.
|
26
|
+
# - If the new value contains a placeholder %e{}, then the value will be
|
27
|
+
# expanded to the relevant environment variable.
|
26
28
|
# @example
|
27
29
|
# update {
|
28
|
-
# "message": "%{
|
30
|
+
# "message": "%e{HOSTNAME}: new message"
|
29
31
|
# }
|
30
32
|
config_param :update, :hash, default: Hash.new
|
31
33
|
|
@@ -40,6 +42,8 @@ module Fluent
|
|
40
42
|
# - If the field does not exist, then it will be created.
|
41
43
|
# - If the new value contains a placeholder %{}, then the value will be
|
42
44
|
# expanded to the related event record field.
|
45
|
+
# - If the new value contains a placeholder %e{}, then the value will be
|
46
|
+
# expanded to the relevant environment variable.
|
43
47
|
# @example
|
44
48
|
# replace {
|
45
49
|
# "new_message": "a new field"
|
@@ -254,7 +258,7 @@ module Fluent
|
|
254
258
|
matches = string.scan(ENVIRONMENT_TAG_REGEXP).map{|m| $~}
|
255
259
|
|
256
260
|
matches.each do |match|
|
257
|
-
reference_tag = match[0][
|
261
|
+
reference_tag = match[0][3..-2]
|
258
262
|
reference_value = case reference_tag
|
259
263
|
when "hostname" then Socket.gethostname
|
260
264
|
else ENV[reference_tag]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mutate_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Serafini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.12.0
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.15.0
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.12.0
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.15.0
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: bundler
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|