fluentd 0.12.6 → 0.12.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/ChangeLog +10 -0
- data/lib/fluent/plugin/filter_record_transformer.rb +9 -7
- data/lib/fluent/plugin/in_tail.rb +4 -1
- data/lib/fluent/version.rb +1 -1
- data/test/plugin/test_filter_record_transformer.rb +18 -0
- data/test/plugin/test_in_tail.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34615d5421761b2b42cd9831d2d87a96ac401b9d
|
4
|
+
data.tar.gz: 49ba7a22424ee071c07c166e35a5bff49720327b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71f71d6e0f4267836f6f683698a9dbe12c5447dd95a19a1a251bde03e058913a6b32de0a7bdad98783efb198660cf5a5dfebe76ec5e60ebf19d698654ded6b6
|
7
|
+
data.tar.gz: 6a09feb33ef26f30c0901d3f0e2e6b046d4a837b1679c69b7c87abf12f2de2cd5ce3a88ff86a220c81ee5a0e0cd8fcb5aea9d9899aa6b757be24ee79d63df2a3
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/ChangeLog
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# v0.12
|
2
2
|
|
3
|
+
## Release 0.12.7 - 2015/03/22
|
4
|
+
|
5
|
+
### New features / Enhancement
|
6
|
+
|
7
|
+
* in_tail: Add exclude_path option to support exclusion of files
|
8
|
+
https://github.com/fluent/fluentd/pull/561
|
9
|
+
* filter_record_transformer: Support placeholders in record keys
|
10
|
+
https://github.com/fluent/fluentd/pull/558
|
11
|
+
|
12
|
+
|
3
13
|
## Release 0.12.6 - 2015/03/03
|
4
14
|
|
5
15
|
### Bug fixes
|
@@ -108,27 +108,29 @@ module Fluent
|
|
108
108
|
|
109
109
|
new_record = @renew_record ? {} : record.dup
|
110
110
|
@keep_keys.each {|k| new_record[k] = record[k]} if @keep_keys and @renew_record
|
111
|
-
@map
|
111
|
+
new_record.merge!(expand_placeholders(@map))
|
112
112
|
@remove_keys.each {|k| new_record.delete(k) } if @remove_keys
|
113
113
|
|
114
114
|
new_record
|
115
115
|
end
|
116
116
|
|
117
|
-
def
|
117
|
+
def expand_placeholders(value)
|
118
118
|
if value.is_a?(String)
|
119
|
-
|
119
|
+
new_value = @placeholder_expander.expand(value)
|
120
120
|
elsif value.is_a?(Hash)
|
121
121
|
new_value = {}
|
122
122
|
value.each_pair do |k, v|
|
123
|
-
new_value[@placeholder_expander.expand(k)] =
|
123
|
+
new_value[@placeholder_expander.expand(k)] = expand_placeholders(v)
|
124
124
|
end
|
125
|
-
value = new_value
|
126
125
|
elsif value.is_a?(Array)
|
126
|
+
new_value = []
|
127
127
|
value.each_with_index do |v, i|
|
128
|
-
|
128
|
+
new_value[i] = expand_placeholders(v)
|
129
129
|
end
|
130
|
+
else
|
131
|
+
new_value = value
|
130
132
|
end
|
131
|
-
|
133
|
+
new_value
|
132
134
|
end
|
133
135
|
|
134
136
|
def tag_prefix(tag_parts)
|
@@ -26,6 +26,7 @@ module Fluent
|
|
26
26
|
|
27
27
|
config_param :path, :string
|
28
28
|
config_param :tag, :string
|
29
|
+
config_param :exclude_path, :array, :default => []
|
29
30
|
config_param :rotate_wait, :time, :default => 5
|
30
31
|
config_param :pos_file, :string, :default => nil
|
31
32
|
config_param :read_from_head, :bool, :default => false
|
@@ -99,6 +100,8 @@ module Fluent
|
|
99
100
|
def expand_paths
|
100
101
|
date = Time.now
|
101
102
|
paths = []
|
103
|
+
|
104
|
+
excluded = @exclude_path.map { |path| path = date.strftime(path); path.include?('*') ? Dir.glob(path) : path }.flatten.uniq
|
102
105
|
@paths.each { |path|
|
103
106
|
path = date.strftime(path)
|
104
107
|
if path.include?('*')
|
@@ -108,7 +111,7 @@ module Fluent
|
|
108
111
|
paths << path
|
109
112
|
end
|
110
113
|
}
|
111
|
-
paths
|
114
|
+
paths - excluded
|
112
115
|
end
|
113
116
|
|
114
117
|
# in_tail with '*' path doesn't check rotation file equality at refresh phase.
|
data/lib/fluent/version.rb
CHANGED
@@ -271,6 +271,7 @@ class RecordTransformerFilterTest < Test::Unit::TestCase
|
|
271
271
|
assert_equal({"hostname" => @hostname, "tag" => @tag, "#{@tag}" => 100}, r['hash_field'])
|
272
272
|
end
|
273
273
|
end
|
274
|
+
|
274
275
|
test "array values with placeholders with enable_ruby #{enable_ruby}" do
|
275
276
|
config = %[
|
276
277
|
enable_ruby #{enable_ruby}
|
@@ -284,6 +285,7 @@ class RecordTransformerFilterTest < Test::Unit::TestCase
|
|
284
285
|
assert_equal([@hostname, @tag], r['array_field'])
|
285
286
|
end
|
286
287
|
end
|
288
|
+
|
287
289
|
test "array and hash values with placeholders with enable_ruby #{enable_ruby}" do
|
288
290
|
config = %[
|
289
291
|
enable_ruby #{enable_ruby}
|
@@ -297,6 +299,22 @@ class RecordTransformerFilterTest < Test::Unit::TestCase
|
|
297
299
|
assert_equal([{"tag" => @tag}], r['mixed_field'])
|
298
300
|
end
|
299
301
|
end
|
302
|
+
|
303
|
+
test "keys with placeholders with enable_ruby #{enable_ruby}" do
|
304
|
+
config = %[
|
305
|
+
enable_ruby #{enable_ruby}
|
306
|
+
renew_record true
|
307
|
+
<record>
|
308
|
+
${hostname} hostname
|
309
|
+
foo.${tag} tag
|
310
|
+
</record>
|
311
|
+
]
|
312
|
+
msgs = ['1', '2']
|
313
|
+
es = emit(config, msgs)
|
314
|
+
es.each_with_index do |(t, r), i|
|
315
|
+
assert_equal({@hostname=>'hostname',"foo.#{@tag}"=>'tag'}, r)
|
316
|
+
end
|
317
|
+
end
|
300
318
|
end
|
301
319
|
|
302
320
|
test 'unknown placeholder (enable_ruby no)' do
|
data/test/plugin/test_in_tail.rb
CHANGED
@@ -389,6 +389,11 @@ class TailInputTest < Test::Unit::TestCase
|
|
389
389
|
timeclass.should_receive(:now).with_no_args.and_return(Time.new(2010, 1, 2, 3, 4, 5))
|
390
390
|
assert_equal EX_PATHS, plugin.expand_paths.sort
|
391
391
|
end
|
392
|
+
|
393
|
+
# Test exclusion
|
394
|
+
exclude_config = EX_CONFIG + " exclude_path [\"#{EX_PATHS.last}\"]"
|
395
|
+
plugin = create_driver(exclude_config, false).instance
|
396
|
+
assert_equal EX_PATHS - [EX_PATHS.last], plugin.expand_paths.sort
|
392
397
|
end
|
393
398
|
|
394
399
|
def test_refresh_watchers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|