# Copy different field with nanoseconds to elasticsearch/kibana @timestamp field

**URL:** https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806
**Category:** Logstash
**Created:** [March 9, 2020, 9:15pm UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806 "2020-03-09T21:15:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![savvy](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@savvy](https://discuss.elastic.co/u/savvy)
#### Post date: [March 9, 2020, 9:15pm UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806/1 "2020-03-09T21:15:54Z")

</div>

> [@Copy another field with nanoseconds to elasticsearch/kibana @timestamp field](https://discuss.elastic.co/t/copy-another-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222541):
>
> Hello, My Elasticsearch is version 7.5 I have a\> date type - @timestamp field b\> string type - event\_timestamp field (format: 2020-03-06 20:28:33:232123456 +0000) sent in each event. What I want to achieve: 1st, I want to copy @timestamp field to another field called ls\_timestamp (ls\_timestamp should have same format as @timestamp after copying) 2nd, I want to copy event\_timestamp field value to @timestamp (I want to see all the nanoseconds from event\_timestamp in @timestamp after copying…

Just posting that here, seems like logstash related. Can someone guide me here?

---

<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 9, 2020, 9:38pm UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806/2 "2020-03-09T21:38:59Z")

</div>

You can use mutate+rename to move fields around, but you [cannot](https://github.com/elastic/logstash/issues/10822) have nanosecond precision for a logstash @timestamp field.

---

<div class="post-metadata">

### Author: ![savvy](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@savvy](https://discuss.elastic.co/u/savvy)
#### Post date: [March 9, 2020, 10:00pm UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806/3 "2020-03-09T22:00:41Z")

</div>

@Badger  
Just curious, I thought date\_nanos was introduced to achieve nanosecond precision in ES 7.0 onwards? Is it something work under progress then?

Then can I use event\_timestamp (2020-03-09 04:58:54.497305256 +0000) in my case, for nano second precision by simply converting into date\_nanos type? If so, what would my index template look like?

---

<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 10, 2020, 1:01am UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806/4 "2020-03-10T01:01:04Z")

</div>

> [@savvy](#):
>
> I thought date\_nanos was introduced to achieve nanosecond precision in ES 7.0

Yes, it was. Support for it may have been added in Kibana too for all I know. But it wasn't added in logstash.

---

<div class="post-metadata">

### Author: ![savvy](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@savvy](https://discuss.elastic.co/u/savvy)
#### Post date: [March 10, 2020, 3:55pm UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806/5 "2020-03-10T15:55:47Z")

</div>

Thanks @Badger.  
I was doing this to be able to sort data based on @timestamp in nano precision level.  
Just to share to everyone, As a workaround, I achieved this by changing event\_timestamp field to date\_nanos type and recreating index with event\_timestamp. Now I am able to sort data on nano precision level based on my producer timing (event\_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 7, 2020, 3:55pm UTC](https://discuss.elastic.co/t/copy-different-field-with-nanoseconds-to-elasticsearch-kibana-timestamp-field/222806/6 "2020-04-07T15:55:50Z")

</div>

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