# How di I map Timestamp to event Timestamp from filebeat thru logstash

**URL:** <https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577>\
**Category:** Logstash\
**Created:** [February 15, 2023, 9:43am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577 "2023-02-15T09:43:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkingstone](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jkingstone](https://discuss.elastic.co/u/jkingstone)\
**Post date:** [February 15, 2023, 9:43am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/1 "2023-02-15T09:43:15Z")

</div>

Hi,  
I want to change the @timestamp to the timestamp out of event.original or message. I don't know what I do wrong.  
right now the @timestamp is the time where the filebeat logfile ist importet thru logstash into elasticsearch.

@timestamp: Feb 15, 2023 @ 10:36:22.692  
event.original: 06-02-2023 13:10:58:034, INFO , ....  
message: 06-02-2023 13:10:58:034, INFO , ...

in my sample.conf I try it with:  
filter {  
date {  
match =\> ["Event Time", "dd-MM-YYYY HH:mm:ss:SSS"]  
target =\> "@timestamp"  
}  
}

Thank you

---

<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:** [February 15, 2023, 5:43pm UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/2 "2023-02-15T17:43:38Z")

</div>

Are you using grok or dissect to parse the [Event Time] field from [message]? What does your configuration look like for that?

---

<div class="post-metadata">

**Author:** ![jkingstone](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jkingstone](https://discuss.elastic.co/u/jkingstone)\
**Post date:** [February 16, 2023, 8:25am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/3 "2023-02-16T08:25:57Z")

</div>

> [@Badger](#):
>
> grok or dissect

I think that's one of my problems or challenges. I entered Grok, but I suspect that this is where the error lies. I already apologize for my ignorance.

filter {  
grok {  
match =\> ["message", "%{SYSLOGBASE} %{GREEDYDATA:new\_message}"]  
}  
date {  
match =\> ["Event Time", "dd-MM-YYYY HH:mm:ss:SSS"]  
target =\> "@timestamp"  
}  
}

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 16, 2023, 7:52pm UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/4 "2023-02-16T19:52:25Z")

</div>

> [@jkingstone](#):
>
> %{SYSLOGBASE}

This is not assigned, should be `%{SYSLOGBASE:[@metadata][EventTime]}`

```auto
date {
  match => ["[@metadata][EventTime]", "dd-MM-YYYY HH:mm:ss:SSS" ]
  target => "@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:** [February 16, 2023, 9:05pm UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/5 "2023-02-16T21:05:34Z")

</div>

> [@Rios](#):
>
> This is not assigned, should be `%{SYSLOGBASE:[@metadata][EventTime]}`

Also, the message format is not going to match SYSLOGBASE. That expects %{MONTH} +%{MONTHDAY} %{TIME}, whereas the [message] field appears to match ISO8601.

---

<div class="post-metadata">

**Author:** ![jkingstone](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jkingstone](https://discuss.elastic.co/u/jkingstone)\
**Post date:** [February 17, 2023, 7:13am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/6 "2023-02-17T07:13:41Z")

</div>

> [@Badger](#):
>
> Also, the message format is not going to match SYSLOGBASE. That expects %{MONTH} +%{MONTHDAY} %{TIME}, whereas the [message] field appears to match ISO8601.

Thank you for the info, but what or how do I have to enter it then?

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 17, 2023, 8:53am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/7 "2023-02-17T08:53:49Z")

</div>

> [@jkingstone](#):
>
> 06-02-2023 13:10:58:034, INFO

`%{DATESTAMP:[@metadata][EventTime]},%{SPACE}%{LOGLEVEL:loglevel}`

---

<div class="post-metadata">

**Author:** ![jkingstone](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jkingstone](https://discuss.elastic.co/u/jkingstone)\
**Post date:** [February 17, 2023, 1:23pm UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/8 "2023-02-17T13:23:41Z")

</div>

I have now updated my Filter, but in Elasticsearch the cells are empty.

filter {  
grok {  
match =\> { "message" =\> %{DATESTAMP:[@metadata][EventTime]},%{SPACE}%{LOGLEVEL:loglevel, %{GREEDYDATA:message}"}  
}  
date {  
match =\> ["timestamp", "dd-MM-yyyy HH:mm:ss:SSS"]  
target =\> "@timestamp"  
}  
}

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 17, 2023, 3:17pm UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/9 "2023-02-17T15:17:32Z")

</div>

[@metadata][EventTime] in _date_:

```auto
filter {
grok {
  match => { "message" => "%{DATESTAMP:[@metadata][EventTime]},%{SPACE}%{LOGLEVEL:loglevel, %{GREEDYDATA:message}" }
}
date {
match => ["[@metadata][EventTime]", "dd-MM-yyyy HH:mm:ss:SSS" ]
target => "@timestamp"
}

}

```

---

<div class="post-metadata">

**Author:** ![jkingstone](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jkingstone](https://discuss.elastic.co/u/jkingstone)\
**Post date:** [February 21, 2023, 6:23am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/10 "2023-02-21T06:23:25Z")

</div>

Thank you, that works 🙂

---

<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:** [March 21, 2023, 6:23am UTC](https://discuss.elastic.co/t/how-di-i-map-timestamp-to-event-timestamp-from-filebeat-thru-logstash/325577/11 "2023-03-21T06:23:26Z")

</div>

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