Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fluent/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Fluent
DEFAULT_SOCKET_PATH = ENV['FLUENT_SOCKET'] || '/var/run/fluent/fluent.sock'
DEFAULT_BACKUP_DIR = ENV['FLUENT_BACKUP_DIR'] || '/tmp/fluent'
DEFAULT_OJ_OPTIONS = Fluent::OjOptions.load_env
DEFAULT_JSON_PARSE_OPTIONS = { allow_duplicate_key: true }.freeze
DEFAULT_JSON_PARSE_OPTIONS = { allow_duplicate_key: true, allow_comments: true }.freeze
DEFAULT_DIR_PERMISSION = 0755
DEFAULT_FILE_PERMISSION = 0644
INSTANCE_ID = ENV['FLUENT_INSTANCE_ID'] || SecureRandom.uuid
Expand Down
12 changes: 12 additions & 0 deletions test/plugin/test_parser_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ def test_parse_with_duplicated_key(data)
end
end

data('oj' => 'oj', 'json' => 'json', 'yajl' => 'yajl')
def test_parse_with_comments(data)
@parser.configure('json_parser' => data)
assert_nothing_raised do
@parser.instance.parse('{
"key1":"a", // for a,
"key1":"b" // for b
}') { |time, record|
}
end
end

data('oj' => 'oj', 'yajl' => 'yajl')
def test_parse_with_large_float(data)
@parser.configure('json_parser' => data)
Expand Down
Loading