I am using HTTPSource in Flume to receive json formatted POST events as follows:
{"username":"xyz","password":"123"}
My question is: should I change the event source (I mean the one that sends json to Flume), so JSON has the following format:
[{ "headers" : { "timestamp" : "434324343", "host" : "random_host.example.com" }, "body" : "{"username":"xyz","password":"123"}" }]
Is this the best way to do this? Or can I change it everywhere?
My conf file for flume agent :
#
Running cat from hadoop fs
$ hadoop fs -ls -R /raw/logs/somes drwxr-xr-x - flume-agent supergroup 0 2015-06-16 12:43 /raw/logs/arquimedes/2015-06-16 -rw-r--r-- 3 flume-agent supergroup 3814 2015-06-16 12:33 /raw/logs/arquimedes/2015-06-16/SomeLogs.1434471803369 -rw-r--r-- 3 flume-agent supergroup 3719 2015-06-16 12:43 /raw/logs/arquimedes/2015-06-16/SomeLogs.1434472404774 $ hadoop fs -cat /raw/logs/somes/2015-06-16/SomeLogs.1434471803369 | head $
(you look right, empty lines)
If now I look at the file (for example, using the binary HUE ):
0000000: 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ................ 0000010: 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ................ 0000020: 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ................
source share