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/plugin/out_webhdfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def verify_config_placeholders_in_path!(conf)
log.error "configuration placeholder #{ph} is now unsupported by webhdfs output plugin."
end
end
raise ConfigError, "there are unsupported placeholders in path."
raise Fluent::ConfigError, "there are unsupported placeholders in path."
end
end

Expand Down
14 changes: 14 additions & 0 deletions test/plugin/test_out_webhdfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@ def test_placeholders_old_style
assert_equal '/hdfs/testing.node.local/file.%Y%m%d%H.log', d.instance.path
end

data("${uuid:hostname}" => "/hdfs/path/file.${uuid:hostname}.log",
"%{uuid:timestamp}" => "/hdfs/path/file.%{uuid:timestamp}.log",
"__UUID_HOSTNAME__" => "/hdfs/path/file.__UUID_HOSTNAME__.log")
test "obsoleted uuid placeholders raise ConfigError" do |path|
conf = config_element(
"ROOT", "", {
"namenode" => "server.local:50070",
"path" => path
})
assert_raise Fluent::ConfigError.new("there are unsupported placeholders in path.") do
create_driver(conf)
end
end

data("%Y%m%d" => ["/hdfs/path/file.%Y%m%d.log", "/hdfs/path/file.20120718.log"],
"%Y%m%d.%H%M" => ["/hdfs/path/file.%Y%m%d.%H%M.log", "/hdfs/path/file.20120718.1503.log"])
test "generate_path" do |(path, expected)|
Expand Down
Loading