# Ingesting nanoseconds into elasticsearch

**URL:** https://discuss.elastic.co/t/ingesting-nanoseconds-into-elasticsearch/202159
**Category:** Logstash
**Created:** [October 3, 2019, 11:55am UTC](https://discuss.elastic.co/t/ingesting-nanoseconds-into-elasticsearch/202159 "2019-10-03T11:55:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![st3inbeiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/st3inbeiss/32/55332_2.png) [@st3inbeiss](https://discuss.elastic.co/u/st3inbeiss)
#### Post date: [October 3, 2019, 11:55am UTC](https://discuss.elastic.co/t/ingesting-nanoseconds-into-elasticsearch/202159/1 "2019-10-03T11:55:58Z")

</div>

I'm trying to get a long of nanoseconds since Unix Epoch through logstash into a `date_nanos` field in elasticsearch. Since elasticsearch has this datatype, I assumed logstash does have it aswell.

However, the date-filter in logstash only supports UNIX and UNIX\_MS as far as I can tell from the documentation. Does anyone have an idea how this is possible or have a workaround for this?

Thanks!

---

<div class="post-metadata">

### Author: ![st3inbeiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/st3inbeiss/32/55332_2.png) [@st3inbeiss](https://discuss.elastic.co/u/st3inbeiss)
#### Post date: [October 29, 2019, 2:40pm UTC](https://discuss.elastic.co/t/ingesting-nanoseconds-into-elasticsearch/202159/2 "2019-10-29T14:40:24Z")

</div>

So basically logstash doesn't support this natively yet. The workaround for this would be to simply build a string field with the format `yyyy-MM-ddTHH:mm:ss.SSSSSSSSSZ`. Once you have a string formatted like this, you can simply index it into an elasticsearch field with the date\_nanos type.

---

<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: [November 26, 2019, 2:40pm UTC](https://discuss.elastic.co/t/ingesting-nanoseconds-into-elasticsearch/202159/3 "2019-11-26T14:40:25Z")

</div>

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