向httppost内容flume添加头

s2j5cfk0  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(282)

我正在测试flume http源代码,hdfs作为sink。下面是使用的conf文件。

httpagent.sources = httpsource 
httpagent.sinks = hdfs-file-sink
httpagent.channels = ch3

httpagent.sources.httpsource.type = http 
httpagent.sources.httpsource.bind = address 
httpagent.sources.httpsource.handler =org.apache.flume.sink.solr.morphline.BlobHandler httpagent.sources.httpsource.channels = ch3 
httpagent.sources.httpsource.port = port

httpagent.sinks.hdfs-file-sink.type = hdfs 
httpagent.sinks.hdfs-file-sink.hdfs.path = hdfs://localhost:8020/flume/events 
httpagent.sinks.hdfs-file-sink.hdfs.fileType=DataStream 
httpagent.sinks.hdfs-file-sink.hdfs.filePrefix = events- 
httpagent.sinks.hdfs-file-sink.hdfs.rollInterval = 30 
httpagent.sinks.hdfs-file-sink.channel = ch3 
httpagent.channels.ch3.type = memory

请求主体将保存在hdfs中。但是我想把http头也附加到post内容中。我该怎么做?

mrphzbgm

mrphzbgm1#

您可能想看看事件序列化程序(https://flume.apache.org/flumeuserguide.html#event-序列化程序)
序列化程序可以按中所述进行设置https://flume.apache.org/flumeuserguide.html#hdfs-Flume
如果需要这些头文件,应该使用avro事件序列化程序或编写自定义的事件序列化程序。

相关问题