2016-02-22 24 views
0

TD-agent.config對其包括fluentd時間爲JSON數據後

<match test> 
type webhdfs 
host localhost 
port 50070 
path /test/%Y%m%d_%H 
username hdfs 
output_include_tag false 
remove_prefix test 
time_format %Y-%m-%d %H:%M:%S 
output_include_time true 
format json 
localtime 
buffer_type file 
buffer_path /test/test 
buffer_chunk_limit 4m 
buffer_queue_limit 50 
flush_interval 3s 
</match> 

HDFS中的日誌文件它顯示如下:

2016-02-22 16:04:15 {"login_id":123,"email":"[email protected]"} 

有什麼辦法嵌入fluentd時間字段不客戶端在json數據存入文件之前將時間存入如:

{"time_key":"2016-02-22 16:04:15","login_id":123,"email":"[email protected]"} 

回答