Skip to content

Commit

Permalink
Merge pull request #478 from fluent/fix_multiple_tag_match
Browse files Browse the repository at this point in the history
fix v1 config to support multiple tag match
  • Loading branch information
sonots committed Nov 21, 2014
2 parents 2f8f423 + e40f9a6 commit 8c7bc1c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/fluent/config/basic_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def initialize(strscan)

LINE_END = /(?:[ \t]*(?:\#.*)?(?:\z|[\r\n]))+/
SPACING = /(?:[ \t\r\n]|\z|\#.*?(?:\z|[\r\n]))+/
ZERO_OR_MORE_SPACING = /(?:[ \t\r\n]|\z|\#.*?(?:\z|[\r\n]))*/
SPACING_WITHOUT_COMMENT = /(?:[ \t\r\n]|\z)+/

module ClassMethods
Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/config/v1_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def parse_element(root_element, elem_name, attrs = {}, elems = [])
elsif skip(/\</)
e_name = scan(ELEMENT_NAME)
spacing
e_arg = scan_nonquoted_string(/(?:#{SPACING}|\>)/)
e_arg = scan_nonquoted_string(/(?:#{ZERO_OR_MORE_SPACING}\>)/)
spacing
unless skip(/\>/)
parse_error! "expected '>'"
Expand Down
8 changes: 6 additions & 2 deletions test/config/test_config_parser.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'helper'
require_relative '../helper'
require_relative "assertions"
require "json"
require "config/assertions"
require "fluent/config/error"
require "fluent/config/basic_parser"
require "fluent/config/literal_parser"
Expand Down Expand Up @@ -229,6 +229,10 @@ def test_not_reject_at_prefix_in_the_parameter_name(data)
"ignores spacing around element argument" => [root(e("test", "a")), %[
<test a >
</test>
]],
"accepts spacing inside element argument (for multiple tags)" => [root(e("test", "a.** b.**")), %[
<test a.** b.** >
</test>
]])
def test_parse_element(data)
expected, target = data
Expand Down
2 changes: 1 addition & 1 deletion test/test_plugin_classes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'helper'
require_relative 'helper'

module FluentTest
class FluentTestOutput < ::Fluent::Output
Expand Down

0 comments on commit 8c7bc1c

Please sign in to comment.