apache flume hdfs接收器可以接受动态路径进行写入吗?

apache flume hdfs接收器可以接受动态路径进行写入吗?,apache,hadoop,hdfs,flume,Apache,Hadoop,Hdfs,Flume,我是apache flume的新手。 我正在尝试了解如何获取json(作为http源),解析它并根据内容将其存储到hdfs上的动态路径中。 例如: 如果json是: [{ "field1" : "value1", "field2" : "value2" }] 那么hdfs路径将是: /某些默认根路径/value1/value2/某些值名称文件 是否有这样的水槽配置使我能够做到这一点 以下是我当前的配置(通过http接受json,并根据时间戳将其存储在路径中): 谢谢 溶液在水槽中

我是apache flume的新手。
我正在尝试了解如何获取json(作为http源),解析它并根据内容将其存储到hdfs上的动态路径中。
例如:
如果json是:

[{   
  "field1" : "value1",
  "field2" : "value2"
}]
那么hdfs路径将是:
/某些默认根路径/value1/value2/某些值名称文件
是否有这样的水槽配置使我能够做到这一点

以下是我当前的配置(通过http接受json,并根据时间戳将其存储在路径中):


谢谢

溶液在水槽中:

以下是修改后的配置:

#flume.conf: http source, hdfs sink

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type =  org.apache.flume.source.http.HTTPSource
a1.sources.r1.port = 9000
#a1.sources.r1.handler = org.apache.flume.http.JSONHandler

# Describe the sink
a1.sinks.k1.type = hdfs
a1.sinks.k1.hdfs.path = /user/uri/events/%{field1}
a1.sinks.k1.hdfs.filePrefix = events-
a1.sinks.k1.hdfs.round = true
a1.sinks.k1.hdfs.roundValue = 10
a1.sinks.k1.hdfs.roundUnit = minute

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1  
还有卷曲:

curl -X POST -d '[{  "headers" : {           "timestamp" : "434324343", "host" :"random_host.example.com", "field1" : "val1"            },  "body" : "random_body"  }]' localhost:9000

我使用的是另一个源(RabbitMQ),我自己也在传递一个JSON负载。你所描述的方法在我的情况下似乎不起作用。我想,除非你面临类似的问题,否则我这边一定有问题
curl -X POST -d '[{  "headers" : {           "timestamp" : "434324343", "host" :"random_host.example.com", "field1" : "val1"            },  "body" : "random_body"  }]' localhost:9000