# Parse RFC3339Nano Date to @timestamp field

**URL:** <https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978>\
**Category:** Logstash\
**Created:** [August 31, 2017, 9:30am UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978 "2017-08-31T09:30:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rucciva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rucciva/32/21699_2.png) [@rucciva](https://discuss.elastic.co/u/rucciva)\
**Post date:** [August 31, 2017, 9:30am UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/1 "2017-08-31T09:30:08Z")

</div>

How do you parse time that is formatted using golang's RFC3339Nano into @timestamp field?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 31, 2017, 11:21am UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/2 "2017-08-31T11:21:29Z")

</div>

It'll be easier to help if you post an example.

---

<div class="post-metadata">

**Author:** ![rucciva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rucciva/32/21699_2.png) [@rucciva](https://discuss.elastic.co/u/rucciva)\
**Post date:** [August 31, 2017, 3:15pm UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/3 "2017-08-31T15:15:43Z")

</div>

Here's one of the example  
"2006-01-02T15:04:05.999999999Z07:00"

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 31, 2017, 4:51pm UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/4 "2017-08-31T16:51:18Z")

</div>

Is that a real example? I thought those timestamps can end with "Z" _or_ a UTC offset, not both.

The `@timestamp` field doesn't have more than millisecond precision and I'm not sure the date filter is able to parse nanoseconds.

---

<div class="post-metadata">

**Author:** ![rucciva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rucciva/32/21699_2.png) [@rucciva](https://discuss.elastic.co/u/rucciva)\
**Post date:** [September 1, 2017, 11:40am UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/5 "2017-09-01T11:40:59Z")

</div>

Iyap. I just copy paste that from the golang time package documentation.

Is there any way to remove the nano second part first and then parse it using date filter?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 3, 2017, 6:37pm UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/6 "2017-09-03T18:37:07Z")

</div>

> Is there any way to remove the nano second part first and then parse it using date filter?

Sure, you can e.g. use a mutate filter's gsub option.

---

<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:** [October 1, 2017, 6:37pm UTC](https://discuss.elastic.co/t/parse-rfc3339nano-date-to-timestamp-field/98978/7 "2017-10-01T18:37:13Z")

</div>

Closed on October 1, 2017, 6:37pm UTC

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