【发布时间】:2018-05-14 11:42:53
【问题描述】:
我已经配置了 fluentd 和 elasticsearch,它们都运行良好。我正在跟踪一个文件,然后读取它的数据并将其发布到 elasticsearch。下面是json数据:
{"time": "2018-05-14T11:37:30.339593", "Data count": 78, "Data status": "Sent", "DataId": "332"}
以下是fluentd配置文件:
<source>
@type tail
time_key time
path /home/user/file.json
format json
tag first
</source>
<match *first*>
@type elasticsearch
hosts 192.168.196.118:9200
user <username>
password <password>
index_name myindex
type_name mytype
id_key 100
time_key time
</match>
在上面的配置文件中,我添加了time_key,因为时间是我想从json数据中使用的时间。但是我在elasticsearch 收到的数据不包含任何时间数据。
另外,我使用的是id_key,但在弹性搜索中,id_key 是一些随机值。
请帮忙。谢谢
【问题讨论】:
标签: elasticsearch logging fluentd