# Unable to parse TIMESTAMP\_ISO8601 timestamp in logstash conf

**URL:** <https://discuss.elastic.co/t/unable-to-parse-timestamp-iso8601-timestamp-in-logstash-conf/267886>\
**Category:** Logstash\
**Created:** [March 20, 2021, 1:06pm UTC](https://discuss.elastic.co/t/unable-to-parse-timestamp-iso8601-timestamp-in-logstash-conf/267886 "2021-03-20T13:06:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micheal25](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Micheal25](https://discuss.elastic.co/u/Micheal25)\
**Post date:** [March 20, 2021, 1:06pm UTC](https://discuss.elastic.co/t/unable-to-parse-timestamp-iso8601-timestamp-in-logstash-conf/267886/1 "2021-03-20T13:06:51Z")

</div>

Hi Team,  
I am having parsing the "TIMESTAMP\_ISO8601" in logstash grok. The only differnce i see in the log message is extra space after the hours : in timestamp

Eg:

2021-03-21T13:(\s) 01:54.402+0000

this is occuring only sepcific set of messages..

---

<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:** [March 20, 2021, 4:33pm UTC](https://discuss.elastic.co/t/unable-to-parse-timestamp-iso8601-timestamp-in-logstash-conf/267886/2 "2021-03-20T16:33:57Z")

</div>

The TIMESTAMP\_ISO8601 pattern does not allow a space there. You will have to use a custom pattern.

---

<div class="post-metadata">

**Author:** ![Micheal25](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Micheal25](https://discuss.elastic.co/u/Micheal25)\
**Post date:** [March 20, 2021, 7:52pm UTC](https://discuss.elastic.co/t/unable-to-parse-timestamp-iso8601-timestamp-in-logstash-conf/267886/3 "2021-03-20T19:52:59Z")

</div>

I have got my timetamp split into two fields with help of patterns directory.

2021-03-21T07:02:01.107+0000 == {TIMESTAMP\_ISO8601: mytimestamp}  
date {  
match =\> ["mytimestamp" , "ISO8601"]  
target =\> "@timestamp"  
}  
2021-03-21T07: 02:01.107+0000 == {CUSTOM\_TS: mytimestmap}  
date {  
match =\> ["mytimestamp" , "MMM dd yyyy HH:mm:ss", "MMM d yyyy HH:mm:ss", "ISO8601"]  
target =\> "@timestamp"  
}  
After making the above changes, i am able to get my pipeline working without any errors, but the @timestamp is still reflecting the ingested timeline and not considering "mytimestamp".

Complete .conf file for reference

```
filter {
  grok {
      patterns_dir => ["/opt/bea/ELKSTACK/logstash-6.2.4/custompatterns/patterns"]
 match => { "message" => ["%{APIGE_TIME:mytimestamp}", "%{TIMESTAMP_ISO8601:mycrcttimestamp}"] }
      overwrite => ["message"]
         }
    date {
        match => ["mycrcttimestamp" , "ISO8601"]
        target => "@timestamp"
           }
    date {
        match => ["mytimestamp" , "MMM dd yyyy HH:mm:ss", "MMM d yyyy HH:mm:ss", "ISO8601"]
        target => "@timestamp"
           }
```

---

<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:** [April 17, 2021, 7:53pm UTC](https://discuss.elastic.co/t/unable-to-parse-timestamp-iso8601-timestamp-in-logstash-conf/267886/4 "2021-04-17T19:53:13Z")

</div>

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