# How to force/change the order of the fields in a event?

**URL:** https://discuss.elastic.co/t/how-to-force-change-the-order-of-the-fields-in-a-event/96786
**Category:** Logstash
**Created:** [August 11, 2017, 2:49pm UTC](https://discuss.elastic.co/t/how-to-force-change-the-order-of-the-fields-in-a-event/96786 "2017-08-11T14:49:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Joaquim\_Freitas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joaquim_freitas/32/20113_2.png) [@Joaquim\_Freitas](https://discuss.elastic.co/u/Joaquim_Freitas)
#### Post date: [August 11, 2017, 2:49pm UTC](https://discuss.elastic.co/t/how-to-force-change-the-order-of-the-fields-in-a-event/96786/1 "2017-08-11T14:49:52Z")

</div>

Hi,

It is possible (or how can it be done) to force/change the order of the fields in a event?

The reason for my question is simple:  
I have a field "\_time" in my events that I need to be the very first field in my JSON events.  
I need to either sort the fields (causing the "\_time" to come first) or move that field to the first position in the event.

It seems a somewhat strange question, but this is due to the fact the event will be output via tcp, and field "\_time" needs to come first in the JSON event in order to be correctly processed (setting the timestamp of the event).

Thanks.

---

<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 11, 2017, 3:28pm UTC](https://discuss.elastic.co/t/how-to-force-change-the-order-of-the-fields-in-a-event/96786/2 "2017-08-11T15:28:39Z")

</div>

> It is possible (or how can it be done) to force/change the order of the fields in a event?

No, sorry. The order of the fields is undefined and can't be relied on.

---

<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 8, 2017, 3:28pm UTC](https://discuss.elastic.co/t/how-to-force-change-the-order-of-the-fields-in-a-event/96786/3 "2017-09-08T15:28:39Z")

</div>

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