# Filebeat - json - elastic search - decoding time stamps

**URL:** <https://discuss.elastic.co/t/filebeat-json-elastic-search-decoding-time-stamps/105970>\
**Category:** Beats\
**Created:** [November 1, 2017, 2:09am UTC](https://discuss.elastic.co/t/filebeat-json-elastic-search-decoding-time-stamps/105970 "2017-11-01T02:09:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![motamedi791](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@motamedi791](https://discuss.elastic.co/u/motamedi791)\
**Post date:** [November 1, 2017, 2:09am UTC](https://discuss.elastic.co/t/filebeat-json-elastic-search-decoding-time-stamps/105970/1 "2017-11-01T02:09:54Z")

</div>

I have setup the filebeat to forward json logfiles to the elasticsearch server. Here is my filebeat configuration:

```
filebeat.prospectors:
- input_type: log
  paths:
    - /data/log/1.log
  json.keys_under_root: true
  json.add_error_key: true
  tail_files: false
  close_removed: true
  clean_removed: true

output.elasticsearch:
  hosts: ["http://XXXXX:9200"]
  template.enabled: true
  template.path: "/etc/filebeat/filebeat.template.json"
  template.overwrite: false
  index: "filebeat"

```

Everything works and the logs are parsed and stored in elasticsearch, however, the @timestamp of the elastic search is not the same as the timestamp in the file.

Here is the first line of the log file:  
{"time":"2017-10-26T12:55:32.772000Z", "field1":"value1"}

and here is the entry in elasticsearch:

@timestamp:October 31st 2017, 21:54:21.687 beat.hostname:XXX [beat.name](http://beat.name):XXX beat.version:5.6.3 field1:value1 input\_type:log offset:63 source:/data/log/1.log time:2017-10-26T12:55:32.772000Z type:log \_id:AV91SWr9ZOS8mHYUUnB1 \_type:doc \_index:filebeat \_score: -

Is it possible to have elasticsearch load the timestamp from the log file itself?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 1, 2017, 12:05pm UTC](https://discuss.elastic.co/t/filebeat-json-elastic-search-decoding-time-stamps/105970/2 "2017-11-01T12:05:34Z")

</div>

You can do this through an [ingest pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html) containing a [date processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-processor.html).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 22, 2017, 2:10am UTC](https://discuss.elastic.co/t/filebeat-json-elastic-search-decoding-time-stamps/105970/3 "2017-11-22T02:10:33Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
