# Convert event timestamp

**URL:** <https://discuss.elastic.co/t/convert-event-timestamp/190858>\
**Category:** Logstash\
**Created:** [July 17, 2019, 3:05am UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858 "2019-07-17T03:05:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eclipsed450](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@eclipsed450](https://discuss.elastic.co/u/eclipsed450)\
**Post date:** [July 17, 2019, 3:05am UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858/1 "2019-07-17T03:05:34Z")

</div>

Hi,

I would like to convert the timestamp from some syslog-type messages into a time-formatted field. It's currently in this format: `19/07/11 01:15:26`. I can't seem to find the right syntax to covert this into a format that is read as time instead of string.

Also, if at all possible, I would like to override the ES document timestamp with this timestamp.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 17, 2019, 1:55pm UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858/2 "2019-07-17T13:55:36Z")

</div>

```
date { match => ["date", "YY/MM/dd HH:mm:ss"] }
```

---

<div class="post-metadata">

**Author:** ![eclipsed450](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@eclipsed450](https://discuss.elastic.co/u/eclipsed450)\
**Post date:** [July 19, 2019, 6:24pm UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858/3 "2019-07-19T18:24:12Z")

</div>

Thanks for the suggestion, it seemed to work when I was pulling in messages from files, but now that I'm pulling in the whole file (per my other post), I want to use the `LastModified` field from the S3 metadata. It's value is follows `2019-07-17T15:50:24.000Z`. Suggestion on how to match that one? 🙂

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 19, 2019, 6:33pm UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858/4 "2019-07-19T18:33:41Z")

</div>

Given that the s3 input does date comparisons on the LastModified metadata field in the sincedb code I do not think you have to parse it, I think it is already a Logstash::TimeStamp, so it should be a date in elasticsearch and show up with a clock next to it in the Kibana field list.

---

<div class="post-metadata">

**Author:** ![eclipsed450](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@eclipsed450](https://discuss.elastic.co/u/eclipsed450)\
**Post date:** [July 19, 2019, 10:37pm UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858/5 "2019-07-19T22:37:22Z")

</div>

Interesting. I don't see that field, but I'll keep playing with this. Thanks again.

---

<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:** [August 16, 2019, 10:37pm UTC](https://discuss.elastic.co/t/convert-event-timestamp/190858/6 "2019-08-16T22:37:23Z")

</div>

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