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
Working environment. Note the small arrow mark next to Time field
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.



