# Filebeat process timestamp from JSON

**URL:** <https://discuss.elastic.co/t/filebeat-process-timestamp-from-json/232910>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 16, 2020, 8:24am UTC](https://discuss.elastic.co/t/filebeat-process-timestamp-from-json/232910 "2020-05-16T08:24:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmoham](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@nmoham](https://discuss.elastic.co/u/nmoham)\
**Post date:** [May 16, 2020, 8:24am UTC](https://discuss.elastic.co/t/filebeat-process-timestamp-from-json/232910/1 "2020-05-16T08:24:14Z")

</div>

I am trying to use the filebeat timestamp processor to overwrite the timestamp from logs to @timestamp field before sending data to Elasticsearch . but the timestamp is kibana still shows the ingest timestamp . Not sure, where I am going wrong.

Appreciate any help or guidance.

Sample event -

```auto
{"timestamp":"15/05/2020 08:24:05.836","level":"ERROR","className":"serviceLOgs","methodName":"GetEntry","message":"GetEntry has an ObjectNotFoundException for EntryId = 282--ERROR","exception":"Svcs.Services.Exceptions.ObjectNotFoundException: Entry [ID=282] not found\r\n at Svcs.Services.DirectoryService.GetEntry(Int32 entryId) in D:\\GIT_C#\\Svcs\\Svcs.Services\\Svcs.cs:line 900"}

```

File beats configuration (.yml)

```auto
filebeat.inputs:

- type: log
  enabled: true
  paths:
    - /opt/svcs-logs/*/Log.txt
  json.keys_under_root: true
  json.add_error_key: true
  processors:
    - timestamp:
        field: timestamp
        layouts:
          - '15/05/2020 08:23:46.603'
    - rename:
        fields:
          - from: "level"
          - to: "log.level"
        ignore_missing: true
    - rename:
        fields:
          - from: "className"
          - to: "class.name"
        ignore_missing: true
    - rename:
        fields:
          - from: "exception"
          - to: "error.message"
        ignore_missing: true
    - rename:
        fields:
          - from: "methodName"
          - to: "method.name"
        ignore_missing: true

  exclude_files: ['.gz$']
  ignore_older: 72h

  fields:
    name: svcs
    environment: stng
  fields_under_root: true

```

---

<div class="post-metadata">

**Author:** ![nmoham](https://avatars.discourse-cdn.com/v4/letter/n/77aa72/32.png) [@nmoham](https://discuss.elastic.co/u/nmoham)\
**Post date:** [May 19, 2020, 12:45pm UTC](https://discuss.elastic.co/t/filebeat-process-timestamp-from-json/232910/2 "2020-05-19T12:45:14Z")

</div>

Got it working . Thanks @Jason_Slater for helping me with the correct layout.

```auto
    - timestamp:
        field: timestamp
        layouts:
          - '02/01/2006 15:04:05.000'
        test:
          - '15/05/2020 08:24:05.836'

```

---

<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:** [June 16, 2020, 12:45pm UTC](https://discuss.elastic.co/t/filebeat-process-timestamp-from-json/232910/3 "2020-06-16T12:45:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
