I have configured fluentd and elasticsearch and they both are working fine. I am tailing a file and then reading its data and publishing it to elasticsearch. Below is the json data:
{"time": "2018-05-14T11:37:30.339593", "Data count": 78, "Data status": "Sent", "DataId": "332"}
and below is the fluentd configuration file:
<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>
In the above configuration file, I have added time_key
as time is the time which I want to use from json data. But the data which I receive in the elasticsearch
do not contain any time data.
Also, I am using id_key
but in the elasticsearch, id_key is some random values.
Please help. Thanks