# Parsing timestamp with extra digits

**URL:** <https://discuss.elastic.co/t/parsing-timestamp-with-extra-digits/144513>\
**Category:** Logstash\
**Created:** [August 15, 2018, 12:05pm UTC](https://discuss.elastic.co/t/parsing-timestamp-with-extra-digits/144513 "2018-08-15T12:05:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mladen](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mladen](https://discuss.elastic.co/u/mladen)\
**Post date:** [August 15, 2018, 12:05pm UTC](https://discuss.elastic.co/t/parsing-timestamp-with-extra-digits/144513/1 "2018-08-15T12:05:14Z")

</div>

Hello,

I have a problem with parsing my Timestamp log. Format is as follows:

2018-08-07 13:31:27.248097

As you can see I have three extra digits for thousandths of a second. I managed to solve it this way:

```
    mutate {
        split => { "Timestamp" => "." }
        add_field => {
            "DateTime" => "%{[Timestamp][0]}"
            "Secondsss" => "%{[Timestamp][1]}"
        }    
    }

    date {
        locale => "en"
        match => ["DateTime", "yyyy-MM-dd HH:mm:ss"]
        timezone => "Europe/Belgrade"
        target => "@timestamp"
    }

```

Is there any more elegant solution that will consume less processing time?

BR,  
Mladen

---

<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 15, 2018, 1:01pm UTC](https://discuss.elastic.co/t/parsing-timestamp-with-extra-digits/144513/2 "2018-08-15T13:01:20Z")

</div>

Why not use this?

```
"yyyy-MM-dd HH:mm:ss.SSSSSSS"
```

---

<div class="post-metadata">

**Author:** ![mladen](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mladen](https://discuss.elastic.co/u/mladen)\
**Post date:** [August 15, 2018, 1:27pm UTC](https://discuss.elastic.co/t/parsing-timestamp-with-extra-digits/144513/3 "2018-08-15T13:27:34Z")

</div>

Thanks a lot it works 🙂. Simplest solution is usually the best solution. I didn't now that I can use S six times 🙂.

BR,  
Mladen

---

<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 12, 2018, 1:27pm UTC](https://discuss.elastic.co/t/parsing-timestamp-with-extra-digits/144513/4 "2018-09-12T13:27:47Z")

</div>

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