2

我在其仅节点(测试)模式下使用水槽;我的水槽以下列方式启动:

水槽节点 -1 -c $FQDN':amqp("exchangeName=[exchange name]", "bindings=[binding name]", "host=127.0.0.1", "port=5672", "userName=[user] ", "password=[pass]", "exchangeType=direct", "durableExchange=false", "queueName=[queue name]", "durableQueue=true", "exclusiveQueue=false", "autoDeleteQueue=false", " useMessageTimestamp=true")|collectorSink("s3n://[Amazon key]:[Amazon secret]@[path at S3]","server");' -s "$@" > "$log" 2>&1

我有兴趣使用水槽传递 .csv 文件。不幸的是,flume 将 .csv 文件转换为 .json,添加了一些字段。

例子:

原消息:

"a,b,c"

水槽将消息转换为:

{"body":"\""a,b,c\"","timestamp":1345380385605,"pri":"INFO","nanos":275832626718182,"host":[host name],"fields":{"rolltag":"20120819-124542793+0000.275789814494811.00000011"}}

如何配置水槽以按原样传递消息?

4

1 回答 1

1

您可以只解析 json 并提取“body”标签。

于 2012-08-20T17:34:55.040 回答