# How can i extract timestamp from my log in logstash

**URL:** <https://discuss.elastic.co/t/how-can-i-extract-timestamp-from-my-log-in-logstash/311484>\
**Category:** Logstash\
**Created:** [August 5, 2022, 7:54am UTC](https://discuss.elastic.co/t/how-can-i-extract-timestamp-from-my-log-in-logstash/311484 "2022-08-05T07:54:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akumar22](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@Akumar22](https://discuss.elastic.co/u/Akumar22)\
**Post date:** [August 5, 2022, 7:54am UTC](https://discuss.elastic.co/t/how-can-i-extract-timestamp-from-my-log-in-logstash/311484/1 "2022-08-05T07:54:19Z")

</div>

Below is the format of my logs

```auto
05-08-2022 13:20:13,468 INFO [stdout] (151_bYD2+EULzJ_SLR_124219_-_mymailfc@mailinator.com) Subject: Products Offer exceeded threshold limit of 10%

```

I want to extract the timestamp from this log and store it in a new field so for the above given log new timestamp field should have value "05-08-2022 13:20:13,468".  
can anyone suggest any way to do this ?

---

<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:** [August 5, 2022, 2:41pm UTC](https://discuss.elastic.co/t/how-can-i-extract-timestamp-from-my-log-in-logstash/311484/2 "2022-08-05T14:41:59Z")

</div>

Use a dissect filter

```
dissect { mapping => { "message" => "%{newField} %{+newField} %{}" } }

```

---

<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:** [September 2, 2022, 2:42pm UTC](https://discuss.elastic.co/t/how-can-i-extract-timestamp-from-my-log-in-logstash/311484/3 "2022-09-02T14:42:17Z")

</div>

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