# I am able to put time in pmmmmm=\> startTime0 how to convert it to time?

**URL:** <https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171>\
**Category:** Logstash\
**Created:** [February 20, 2019, 9:47am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171 "2019-02-20T09:47:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamespb](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jamespb](https://discuss.elastic.co/u/jamespb)\
**Post date:** [February 20, 2019, 9:47am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/1 "2019-02-20T09:47:01Z")

</div>

I am able to put time in pmmmmm=\> startTime0 how to convert it to time?  
Thanks a lot

```
    "pmmmmm" => {
                "ShPNR" => 0.0,
    "RelayShPNRNoRoute" => 0.0,
       "RelayRcvdShPNR" => 0.0,
          "pmContainer" => "CSCF-1/COMMON-1/SH-1",
     "pmNetworkElement" => "network_element",
      "measurementType" => "SH",
           "startTime0" => "2019-02-07T23:45:00.000-03:00:00"
}
```

---

<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 20, 2019, 1:06pm UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/2 "2019-02-20T13:06:29Z")

</div>

Use a [date](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html) filter to parse [pmmmmm][startTime0]

---

<div class="post-metadata">

**Author:** ![jamespb](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jamespb](https://discuss.elastic.co/u/jamespb)\
**Post date:** [February 21, 2019, 3:07am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/3 "2019-02-21T03:07:47Z")

</div>

Thanks

"startTime0" =\> "2019-02-07T23:45:00.000"

```
    date {
            match => ["[pmmmmm][startTime0]", "YYYY-MM-DD HH:MM:SS.SSS" ]
            timezone => "UTC"
    }

```

but still get [1] "\_dateparsefailure"

---

<div class="post-metadata">

**Author:** ![jamespb](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jamespb](https://discuss.elastic.co/u/jamespb)\
**Post date:** [February 21, 2019, 3:19am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/4 "2019-02-21T03:19:17Z")

</div>

I have change starttime0 3 format all does not work  
"2019-02-07T23:45:00.000-03:00:00"  
"2019-02-07T23:45:00.000"  
"2019-02-07 23:45:00.000"

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [February 21, 2019, 8:22am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/5 "2019-02-21T08:22:48Z")

</div>

Your orginal startTime0 should be something like below.

```auto
date {
            match => ["[pmmmmm][startTime0]", "YYYY-MM-DDTHH:MM:SS.SSS-HH:MM:SS" ]
            timezone => "UTC"
    }

```

In your second startTime0 example you can add the format to the initial match like so.

```auto
date {
            match => ["[pmmmmm][startTime0]", "YYYY-MM-DDTHH:MM:SS.SSS-HH:MM:SS", "YYYY-MM-DDTHH:MM:SS.SSS", "YYYY-MM-DD HH:MM:SS.SSS" ]
            timezone => "UTC"
    }

```

Have a [read here on date match](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-match)

---

<div class="post-metadata">

**Author:** ![jamespb](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jamespb](https://discuss.elastic.co/u/jamespb)\
**Post date:** [March 4, 2019, 3:19am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/6 "2019-03-04T03:19:39Z")

</div>

works. thanks

---

<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 1, 2019, 3:19am UTC](https://discuss.elastic.co/t/i-am-able-to-put-time-in-pmmmmm-starttime0-how-to-convert-it-to-time/169171/7 "2019-04-01T03:19:41Z")

</div>

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