title: How to add timestamp & key for elasticsearch using fluent
body: <p>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:</p>
  
  <pre><code>{"time": "2018-05-14T11:37:30.339593", "Data count": 78, "Data status": "Sent", "DataId": "332"}
  </code></pre>
  
  <p>and below is the fluentd configuration file:</p>
  
  <pre><code>&lt;source&gt;
    @type tail
    time_key time
    path /home/user/file.json
    format json
    tag first
  &lt;/source&gt;
  
  &lt;match *first*&gt;
    @type elasticsearch
    hosts 192.168.196.118:9200
    user &lt;username&gt;
    password &lt;password&gt;
    index_name myindex
    type_name mytype
    id_key 100
    time_key time
  &lt;/match&gt;
  </code></pre>
  
  <p>In the above configuration file, I have added <code>time_key</code> as time is the time which I want to use from json data. But the data which I receive in the <code>elasticsearch</code> do not contain any time data.</p>
  
  <p>Also, I am using <code>id_key</code> but in the elasticsearch, id_key is some random values.</p>
  
  <p>Please help. Thanks</p>