【发布时间】:2017-09-13 04:43:21
【问题描述】:
我有一些文件,每行都包含 json
[root@ip-172-29-1-12 vp_flume]# more vp_170801.txt.finished | awk '{printf("%s\n", substr($0,0,20))}'
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
{"status":"OK","resp
我的水槽配置是
[root@ip-172-29-1-12 flume]# cat flume_test.conf
agent.sources = seqGenSrc
agent.channels = memoryChannel
agent.sinks = loggerSink
agent.sources.seqGenSrc.type = spooldir
agent.sources.seqGenSrc.spoolDir = /moveitdata/dong/vp_flume
agent.sources.seqGenSrc.deserializer.maxLineLength = 10000000
agent.sources.seqGenSrc.fileSuffix = .finished
agent.sources.seqGenSrc.deletePolicy = never
agent.sources.seqGenSrc.channels = memoryChannel
agent.sinks.loggerSink.channel = memoryChannel
agent.channels.memoryChannel.type = memory
agent.channels.memoryChannel.capacity = 100
agent.sinks.loggerSink.type = hdfs
agent.sinks.loggerSink.hdfs.path = /home/dong/vp_flume
agent.sinks.loggerSink.hdfs.writeFormat = Text
agent.sinks.loggerSink.hdfs.rollInterval = 0
agent.sinks.loggerSink.hdfs.rollSize = 1000000000
agent.sinks.loggerSink.hdfs.rollCount = 0
HDFS 中的文件是:
[root@ip-172-29-1-12 flume]# hadoop fs -text /home/dong/vp_flume/* | awk '{printf("%s\n", substr($0,0,20))}' | more
1505276698665 {"stat
1505276698665 {"stat
1505276698666 {"stat
1505276698666 {"stat
1505276698666 {"stat
1505276698667 {"stat
1505276698667 {"stat
1505276698667 {"stat
1505276698668 {"stat
1505276698668 {"stat
1505276698668 {"stat
1505276698668 {"stat
1505276698669 {"stat
1505276698669 {"stat
1505276698669 {"stat
1505276698669 {"stat
1505276698670 {"stat
1505276698670 {"stat
1505276698670 {"stat
1505276698670 {"stat
问题:我不喜欢flume在每个事件中添加的时间戳。但是,如何通过正确配置flume来摆脱它呢?
【问题讨论】:
标签: flume-ng