fluent-plugin-filter_where 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/fluent-plugin-filter_where.gemspec +1 -1
- data/lib/fluent/plugin/filter_where/core.rb +1 -1
- data/lib/fluent/plugin/filter_where/parser.rex +7 -1
- data/lib/fluent/plugin/filter_where/parser.rex.rb +6 -1
- data/lib/fluent/plugin/filter_where/parser/literal.rb +7 -5
- data/test/test_where_parser.rb +1 -1
- 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: 9e758b04ade2bd2cff6ff9e2ed181a5e621493fc
|
4
|
+
data.tar.gz: e9c2b7cedb2c2d5cbdcb07f3536ff6bf559b7458
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4be09bba4b267d18a125314fa6499ce05a368c13278c390f3bd44acd587d316fcfa18c211a0dff6aa188375aeeda571ace5a8bb4d8310472656ca22bec98869
|
7
|
+
data.tar.gz: c5cba7efd6332ba53083e0732918a83919b883257973f07c8a0417f24e792fc0feafba96a2cf39ec82cb2fa64b17f26a59df2e2155be1c92e9d27fbc32468e61
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "fluent-plugin-filter_where"
|
6
|
-
gem.version = "1.0.
|
6
|
+
gem.version = "1.0.2"
|
7
7
|
gem.authors = ["Naotoshi Seo"]
|
8
8
|
gem.email = "sonots@gmail.com"
|
9
9
|
gem.homepage = "https://github.com/sonots/fluent-plugin-filter_where"
|
@@ -86,7 +86,13 @@ rule
|
|
86
86
|
:STRING \\ { @string << "\\"; nil }
|
87
87
|
|
88
88
|
inner
|
89
|
+
attr_reader :log
|
90
|
+
def initialize(log: nil)
|
91
|
+
@log = log || ::Logger.new(nil)
|
92
|
+
super()
|
93
|
+
end
|
94
|
+
|
89
95
|
def on_error(error_token_id, error_value, value_stack)
|
90
|
-
|
96
|
+
raise Fluent::ConfigError.new("filter_where: failed to parse where value_stack:#{value_stack} error_value:#{error_value.inspect}")
|
91
97
|
end
|
92
98
|
end
|
@@ -200,7 +200,12 @@ class Fluent::FilterWhere::Parser < Racc::Parser
|
|
200
200
|
token
|
201
201
|
end # def _next_token
|
202
202
|
|
203
|
+
attr_reader :log
|
204
|
+
def initialize(log: nil)
|
205
|
+
@log = log || ::Logger.new(nil)
|
206
|
+
super()
|
207
|
+
end
|
203
208
|
def on_error(error_token_id, error_value, value_stack)
|
204
|
-
|
209
|
+
raise Fluent::ConfigError.new("filter_where: failed to parse where value_stack:#{value_stack} error_value:#{error_value.inspect}")
|
205
210
|
end
|
206
211
|
end # class
|
@@ -41,14 +41,16 @@ module Fluent
|
|
41
41
|
end
|
42
42
|
|
43
43
|
class IdentifierLiteral < Literal
|
44
|
-
|
45
|
-
|
46
|
-
def initialize(name)
|
47
|
-
@name = name
|
44
|
+
def initialize(text)
|
45
|
+
@text = text
|
48
46
|
end
|
49
47
|
|
50
48
|
def get(record)
|
51
|
-
record[@
|
49
|
+
record[@text]
|
50
|
+
end
|
51
|
+
|
52
|
+
def name
|
53
|
+
@text
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
data/test/test_where_parser.rb
CHANGED
@@ -53,7 +53,7 @@ class WhereParserTest < Test::Unit::TestCase
|
|
53
53
|
assert_true(result.eval(record))
|
54
54
|
result = parser.scan(%q[boolean != false])
|
55
55
|
assert_true(result.eval(record))
|
56
|
-
assert_raise(
|
56
|
+
assert_raise(Fluent::ConfigError) { parser.scan(%q[boolean > false]) }
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_number_op
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-filter_where
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|