0

有没有办法在flume存储的HDFS接收器中配置(通过事件动态)文件名?HDFS sink 提供以下名称配置。

hdfs.filePrefix
hdfs.fileSuffix
4

1 回答 1

1

是的。您可以通过以下参数配置 HDFS sink 中的文件名。

hdfs.filePrefix = <<FILE_PREFIX>>-%{host}-%d-%H-%m-%s
hdfs.fileSuffix = <<FILE_SUFFIX>>-%{host}-%d-%H-%m-%s

%{host} = "It will pick up the hostname of your machine"
%t = "It will provide unix time in milliseconds "
%d= "Date"
%H= "Hour"
%m= "minutes"
%s= "seconds"

因此 Flume Bucket writer 打开线程到 hdfs 进行写入,通过使用“Prifix/Suffix”我们可以动态创建文件名。

于 2013-11-03T19:40:54.870 回答