fluent-plugin-path2tag 1.0.2 → 1.0.3

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: 4ce7083d0a2838491533ea2e832dffbcbbe1d778
4
- data.tar.gz: 10b2a10bf269a95bbf0213fad948be83cdbaeebe
3
+ metadata.gz: 6184b0c3f2880c16bca0e54de830ff95a1f9e208
4
+ data.tar.gz: 593dd033811e80535d6848c97a162d3dda802e29
5
5
  SHA512:
6
- metadata.gz: fe9220a2772ed405cacdac1125926f3c3c19468c900249b447e412b991124d87471ec9daaedc9ee9833aa98bff2f38ef26561b1765beaf358e0cafab638a653c
7
- data.tar.gz: 56676e027e35e26a87fce7de97f03d8e2bf4773e38113df7b373664381f98690c5de0c0a2a649e4076ad4e47a4a8bc4a9e5994d53d3975faed703fcc55372da3
6
+ metadata.gz: 42f85e5cffb63d532e412a3ee8328a6bc1aa7a061283972a1b1f1ee6c2975f7d57bdfbe7cb864141916eed3f83dcb9de578586f1aca12fb600bc4eaa933ae956
7
+ data.tar.gz: c9b554a0a47f83803744720d6958202164c3c52c6f2bb3945dc1f99eb6d7212e95b523063acc0f076d2398dc603ed9bf611755c6ff311d84319dcb949a2d4c75
data/README.md CHANGED
@@ -10,10 +10,10 @@ Convert uri to tag. And reformat json data.
10
10
  $ gem install fluent-plugin-path2tag
11
11
 
12
12
  # for td-agent (Legacy)
13
- $ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install ffluent-plugin-path2tag -v 1.0.2
13
+ $ sudo /usr/lib64/fluent/ruby/bin/fluent-gem install ffluent-plugin-path2tag -v 1.0.3
14
14
 
15
15
  # for td-agent2 (with fluentd v0.12)
16
- $ sudo td-agent-gem install fluent-plugin-path2tag -v 1.0.2
16
+ $ sudo td-agent-gem install fluent-plugin-path2tag -v 1.0.3
17
17
  ```
18
18
 
19
19
  ## Configuration
@@ -88,6 +88,11 @@ class Fluent::Path2tagOutput < Fluent::Output
88
88
  end
89
89
  newtag = newtag.gsub("/", ".")
90
90
 
91
+ index = newtag.index("?")
92
+ unless index.nil?
93
+ newtag = newtag.slice(0, newtag.index("?"))
94
+ end
95
+
91
96
  return newtag, newrecords
92
97
  end
93
98
  end
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Path2tag
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -127,6 +127,18 @@ class Path2tagTest < Test::Unit::TestCase
127
127
  assert_equal 'path', emits[0][0]
128
128
  assert_equal JSON.parse(body), emits[0][2]
129
129
  end
130
+
131
+ def test_emit_path_format_5
132
+ d1 = create_driver(CONFIG_OK, 'nginx.access')
133
+ body = '{"fluentd_time":"2017-02-20 10:39:14 UTC","unique_id":"123ABC","device_token":"ABC123"}'
134
+ d1.run do
135
+ d1.emit({'request_uri' => 'path/foo/bar?param1=1?param2=2', 'request_body' => body})
136
+ end
137
+ emits = d1.emits
138
+ assert_equal 1, emits.length
139
+ assert_equal 'path.foo.bar', emits[0][0]
140
+ assert_equal JSON.parse(body), emits[0][2]
141
+ end
130
142
 
131
143
  def test_emit_json_parse
132
144
  d1 = create_driver(CONFIG_OK, 'nginx.access')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-path2tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Kuwahara