# Unable to sort kibana UI based on time fields in few environments

**URL:** <https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517>\
**Category:** Kibana\
**Created:** [February 12, 2018, 5:05pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517 "2018-02-12T17:05:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gangadhar\_Mahadevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gangadhar_mahadevan/32/62579_2.png) [@Gangadhar\_Mahadevan](https://discuss.elastic.co/u/Gangadhar_Mahadevan)\
**Post date:** [February 12, 2018, 5:05pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/1 "2018-02-12T17:05:14Z")

</div>

I am having an issue where am unable to sort logs in kibana based on timestamp in our production environment but works fine in pre-production. Our index pattern is same(logstash-cos-\*) and time field is set to orig\_timestamp(This field definitely exists in all logs flowing to ES and kibana). In one of previous cases we cleared the .kibana index cache, stopped kibana process to delete .kibana index and re-started the process. That way .kibana index gets re-created and creating new index pattern fixed the issue, but this time it didn't work. Also whenever we delete .kibana index and re-create we lose our existing dashboards/visualization too which is not ideal.

The UI by default sorts by score but we are able to sort records based on timestamp using ES API calls.

Non-working Environment

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/3/63a1a0d324cddf7c5c9fb0d6d8444c851392f3fb.png)

Working environment. Note the small arrow mark next to Time field

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7b3b65d65eedd031fc38f61bdc86e1ff73e34568.png)

The UI routes in non-working environment routes to

https:///app/kibana#/discover?\_g=()&\_a=(columns:!(\_source),index:'logstash-cos-_',interval:auto,query:(query\_string:(analyze\_wildcard:!t,query:'_')),**sort:!(\_score,desc))**

Whereas in working environment it routes to

https:///app/kibana#/discover?\_g=()&\_a=(columns:!(\_source),index:'logstash-cos-_',interval:auto,query:(query\_string:(analyze\_wildcard:!t,query:'_')),**sort:!(orig\_timestamp,desc))**

Is there a way to restrict sorting based on score field? If you want to look at mapping between the 2 environments or need further details please let me know.

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [February 12, 2018, 8:41pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/2 "2018-02-12T20:41:41Z")

</div>

@Gangadhar_Mahadevan if you go to Management -\> Index Patterns, and then select your index pattern, do you see the following icon next to the `orig_timestamp` field?

![56%20PM](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6d37bdcdfd69c42a23b8e4225ee42188cd74d582.png)

Are both instances the same version of Kibana?

---

<div class="post-metadata">

**Author:** ![Gangadhar\_Mahadevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gangadhar_mahadevan/32/62579_2.png) [@Gangadhar\_Mahadevan](https://discuss.elastic.co/u/Gangadhar_Mahadevan)\
**Post date:** [February 12, 2018, 8:48pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/3 "2018-02-12T20:48:25Z")

</div>

Hi Brandon,

This is what I see and yes both working and non-working environments are on the same kibana version

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/d/3d5d702cb3c304bec2ec0c01231a416cd55d38a2.png)

The only difference is in working environment we load them via kibana IP:port (pre-prod environments) and non-working production environment we load them using load balancer URL

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [February 12, 2018, 8:49pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/4 "2018-02-12T20:49:24Z")

</div>

So, if you open a new browser, and go to Discover in the environment that it's not working, what URL do you see?

---

<div class="post-metadata">

**Author:** ![Gangadhar\_Mahadevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gangadhar_mahadevan/32/62579_2.png) [@Gangadhar\_Mahadevan](https://discuss.elastic.co/u/Gangadhar_Mahadevan)\
**Post date:** [February 12, 2018, 8:51pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/5 "2018-02-12T20:51:22Z")

</div>

It's like https:///app/kibana#/discover?\_g=()&\_a=(columns:!(\_source),index:'logstash-cos-',interval:auto,query:(query\_string:(analyze\_wildcard:!t,query:'')),sort:!(\_score,desc))

It defaults the sort to score,desc and even if I edit it to sort:!(orig\_timestamp,desc) the discover page doesn't reflect it

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [February 12, 2018, 10:24pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/6 "2018-02-12T22:24:23Z")

</div>

@Gangadhar_Mahadevan which version of Kibana are you using? Have you compared the Management -\> Advanced Settings between the two instances as well?

---

<div class="post-metadata">

**Author:** ![Gangadhar\_Mahadevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gangadhar_mahadevan/32/62579_2.png) [@Gangadhar\_Mahadevan](https://discuss.elastic.co/u/Gangadhar_Mahadevan)\
**Post date:** [February 12, 2018, 10:25pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/7 "2018-02-12T22:25:52Z")

</div>

We are on kibana 5.2 . Haven't looked deeply at advanced settings. Anything in specific that we should watch out for? We usually don't modify any advanced settings at all

Thanks!

---

<div class="post-metadata">

**Author:** ![Gangadhar\_Mahadevan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gangadhar_mahadevan/32/62579_2.png) [@Gangadhar\_Mahadevan](https://discuss.elastic.co/u/Gangadhar_Mahadevan)\
**Post date:** [February 13, 2018, 4:30pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/8 "2018-02-13T16:30:17Z")

</div>

Hi @Brandon_Kobel. Checked the advanced settings between 2 environments and didn't notice any difference at all. Any guidance on what to look for next? Let me know if you need additional information

---

<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:** [March 13, 2018, 4:30pm UTC](https://discuss.elastic.co/t/unable-to-sort-kibana-ui-based-on-time-fields-in-few-environments/119517/9 "2018-03-13T16:30:41Z")

</div>

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