Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ajoliveira opened this issue Sep 12, 2019 · 1 comment · Fixed by #74336
Closed
Assignees
Labels
Feature:Discover Discover Application

Comments

@ajoliveira
Copy link

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

@ajoliveira ajoliveira added the Feature:Discover Discover Application label Sep 12, 2019
@kertal kertal closed this as completed May 6, 2020
@kertal kertal reopened this May 6, 2020
@kertal
Copy link
Member

kertal commented May 6, 2020

This is a similar behavior to #54345 when you're changing index pattern, columns an sort aren't reset, except when the new index pattern doesn't contain the old sort field, then it's reset to default. So it ain't a bug, but it's certainly a reason for confusion, so there's certainly room for improvement here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants