Skip to content

Discover sorting incorrect when index patterns have same field but different 'Time' field. #45557

@ajoliveira

Description

@ajoliveira

Kibana version: 7.3.1 (also 6.6.X)

Elasticsearch version: 7.3.1

Server OS version: macOS 10.14.6

Browser version: Chrome 76.0.3809.132 / FF 68.0.1

Browser OS version: macOS 10.14.6

Original install method (e.g. download page, yum, from source, etc.): download page

Describe the bug: Discover view does not properly sort when 2 index patterns contain same timestamp field, even though one index has another time field designated as the 'Time Filter field name'.

Steps to reproduce:

  1. Sample Data:
PUT testindex-timestamp1/_doc/1
{"body":{"timestamp":"2019-09-11T06:24:20.7832424+00:00"}} 
PUT testindex-timestamp1/_doc/2
{"body":{"timestamp":"2019-09-11T07:24:20.7832424+00:00"}} 
PUT testindex-timestamp1/_doc/3
{"body":{"timestamp":"2019-09-11T05:24:20.7832424+00:00"}}
PUT testindex-timestamp1/_doc/4
{"body":{"timestamp":"2019-09-11T08:24:20.7832424+00:00"}} 

DELETE testindex-timestamp2

PUT testindex-timestamp2/_doc/1
{"body":{"sentTimestamp":"2019-09-11T12:24:20.7832424+00:00","timestamp":"2019-09-11T10:24:20.7832424+00:00"}} 
PUT testindex-timestamp2/_doc/2
{"body":{"sentTimestamp":"2019-09-11T09:24:20.7832424+00:00","timestamp":"2019-09-11T09:24:20.7832424+00:00"}}
PUT testindex-timestamp2/_doc/3
{"body":{"sentTimestamp":"2019-09-11T10:54:20.7832424+00:00","timestamp":"2019-09-11T10:24:20.7832424+00:00"}} 
PUT testindex-timestamp2/_doc/4
{"body":{"sentTimestamp":"2019-09-11T10:54:20.7832424+00:00","timestamp":"2019-09-11T08:24:20.7832424+00:00"}} 
  1. Create index pattern for testindex-timestamp1* and testindex-timestamp2* setting Time Filter name as body.timestamp and body.sentTimestamp, respectively
  2. In Discover tab, if you select testindex-timestamp1* any time before testindex-timestamp2*, the sorting always remains on body.timestamp instead of body.sentTimestamp

Kibana URL also remains showing sort:!(body.timestamp,desc)). However, if you have some other index pattern loaded that does not have the body.timestamp field (ie: packetbeat for exampe) and then switch to testindex-timestamp2*, sorting will be correct.

Expected behavior: Sorting to correctly change to the correct field. It appears that chart updates to reflect body.sentTimestamp as the correct field but the table view continues to sort by the other field.

Screenshots (if relevant):
Screen Shot 2019-09-12 at 1 37 25 PM

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions