Flume changes output format from .csv to .json

640 Views Asked by At

I'm using flume in its node-only (testing) mode; My flume is started in following manner:

flume node -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

I'm interested to pass .csv files with flume. Unfortunately, flume turns .csv file to .json, adding some fields.

Example:

original messsage:

"a,b,c"

flume transforms the message into:

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

How can I configure flume to pass the message as is?

1

There are 1 best solutions below

0
On

You can just parse the json and extract the 'body' tag.