fluent-plugin-tail_path 0.0.1 → 0.0.2

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: 2b4639f29d0249ebd21ba0e5691498bf4b78e301
4
- data.tar.gz: 2e6c03cb4576e8454348da3785b76edd5425f908
3
+ metadata.gz: 88f11331238a6584b6ab7b811edeb79cf02a9743
4
+ data.tar.gz: 617b94b24763f6bd972a6cfc0f4a931fcefad468
5
5
  SHA512:
6
- metadata.gz: 4e6b5b7ac271210134c713f97ca1eca279fccf46e278db730e8d34d841aa7f5b6ac40f18c480acebff9d53231c28ede20c87333cc1ee223ce8ef8b0aa431869d
7
- data.tar.gz: 1d02771648360cddea2c64a2d2d0d36eb9b409ecd687ce9da2eebd39c8bbed28ee06ec08ee133121c375e508c1a9db1f973dcaca8898598da11b415905325e75
6
+ metadata.gz: c91fe5f2ea0bf0e4ee7707c6094eb7324513bf72f0699dd7121b55261b9bf59ade730e3fd390b7b602cf7c6dc6c654020c938ee5fd8797db9ff17c053eadeba5
7
+ data.tar.gz: 144cf81e952b726b6bc8056e4faa7fb24f36e195fb1296047a6c51ed2489c9e8e30a22d08f548e4f713ae0270671a2881d7b7f8dc08360a304328e09d1a564e5
data/.travis.yml CHANGED
@@ -4,3 +4,4 @@ rvm:
4
4
  - 2.1.*
5
5
  gemfile:
6
6
  - Gemfile
7
+ - "Gemfile.fluentd.lt.0.10.50"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.0.2 (2014/08/04)
2
+
3
+ Fixes:
4
+
5
+ * Fix to support fluentd >= 0.10.50
6
+
1
7
  ## 0.0.1
2
8
 
3
9
  First version
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+ gem 'fluentd', '0.10.49'
data/README.md CHANGED
@@ -1,8 +1,16 @@
1
1
  # fluent-plugin-tail_path
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/sonots/fluent-plugin-tail_path.png?branch=master)](http://travis-ci.org/sonots/fluent-plugin-tail_path)
4
+
3
5
  ## About
4
6
 
5
- This is an extension of fluentd in\_tail plugin to add `path` field which tells the log path being tailed
7
+ This is an extension of fluentd in\_tail plugin to add `path` field which tells the log path being tailed.
8
+
9
+ This plugin was created based on a pull request [fluentd#281](https://github.com/fluent/fluentd/pull/281).
10
+
11
+ ## Requirements
12
+
13
+ Fluentd v0.10.45 or above.
6
14
 
7
15
  ## Parameters
8
16
 
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-tail_path"
6
- s.version = "0.0.1"
6
+ s.version = "0.0.2"
7
7
  s.authors = ["szhem", "Naotoshi Seo"]
8
8
  s.email = ["sonots@gmail.com"]
9
9
  s.homepage = "https://github.com/sonots/fluent-plugin-tail_path"
@@ -9,21 +9,45 @@ class Fluent::NewTailPathInput < Fluent::NewTailInput
9
9
  super
10
10
  end
11
11
 
12
- # Override to add path field
13
- def convert_line_to_event(line, es, tail_watcher)
14
- begin
15
- line.chomp! # remove \n
16
- time, record = parse_line(line)
17
- if time && record
18
- record[@path_key] ||= tail_watcher.path unless @path_key.nil?
19
- es.add(time, record)
20
- else
21
- log.warn "pattern not match: #{line.inspect}"
12
+ if method_defined?(:parse_line) # fluentd < 0.10.50
13
+
14
+ # Override to add path field
15
+ def convert_line_to_event(line, es, tail_watcher)
16
+ begin
17
+ line.chomp! # remove \n
18
+ time, record = parse_line(line)
19
+ if time && record
20
+ record[@path_key] ||= tail_watcher.path unless @path_key.nil? # custom
21
+ es.add(time, record)
22
+ else
23
+ log.warn "pattern not match: #{line.inspect}"
24
+ end
25
+ rescue => e
26
+ log.warn line.dump, :error => e.to_s
27
+ log.debug_backtrace(e)
22
28
  end
23
- rescue => e
24
- log.warn line.dump, :error => e.to_s
25
- log.debug_backtrace(e)
26
29
  end
30
+
31
+ else # fluentd >= 0.10.50
32
+
33
+ # Override to add path field
34
+ def convert_line_to_event(line, es, tail_watcher)
35
+ begin
36
+ line.chomp! # remove \n
37
+ @parser.parse(line) { |time, record|
38
+ if time && record
39
+ record[@path_key] ||= tail_watcher.path unless @path_key.nil? # custom
40
+ es.add(time, record)
41
+ else
42
+ log.warn "pattern not match: #{line.inspect}"
43
+ end
44
+ }
45
+ rescue => e
46
+ log.warn line.dump, :error => e.to_s
47
+ log.debug_backtrace(e)
48
+ end
49
+ end
50
+
27
51
  end
28
52
 
29
53
  # Override to pass tail_watcher to convert_line_to_event
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-tail_path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - szhem
@@ -9,62 +9,62 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-28 00:00:00.000000000 Z
12
+ date: 2014-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.10.45
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.10.45
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: pry
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: pry-nav
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  description: Fluentd in_tail extension to add `path` field
@@ -74,10 +74,11 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - .gitignore
78
- - .travis.yml
77
+ - ".gitignore"
78
+ - ".travis.yml"
79
79
  - CHANGELOG.md
80
80
  - Gemfile
81
+ - Gemfile.fluentd.lt.0.10.50
81
82
  - LICENSE
82
83
  - README.md
83
84
  - Rakefile
@@ -94,17 +95,17 @@ require_paths:
94
95
  - lib
95
96
  required_ruby_version: !ruby/object:Gem::Requirement
96
97
  requirements:
97
- - - '>='
98
+ - - ">="
98
99
  - !ruby/object:Gem::Version
99
100
  version: '0'
100
101
  required_rubygems_version: !ruby/object:Gem::Requirement
101
102
  requirements:
102
- - - '>='
103
+ - - ">="
103
104
  - !ruby/object:Gem::Version
104
105
  version: '0'
105
106
  requirements: []
106
107
  rubyforge_project: fluent-plugin-tail_path
107
- rubygems_version: 2.0.3
108
+ rubygems_version: 2.2.0
108
109
  signing_key:
109
110
  specification_version: 4
110
111
  summary: Fluentd in_tail extension to add `path` field