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] Field statistics request fails for epoch_second timestamp mappings #148140
Comments
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
Thanks, @kertal, for catching it! |
Closes #148140 ## Summary This PR fixes time format so it can work also for epoch. Before: <img width="400" alt="Screenshot 2023-01-03 at 12 33 17" src="https://user-images.githubusercontent.com/1415710/210350243-b3ae1d1a-4c76-46e7-930f-0ca9835dc121.png"> After: <img width="400" alt="Screenshot 2023-01-03 at 12 32 49" src="https://user-images.githubusercontent.com/1415710/210350274-af80f558-6a32-4da6-9cb9-857a8cb3de70.png"> Sample data for testing: ``` PUT test PUT test/_mapping { "properties": { "timestamp": { "type": "date", "format": "epoch_second" }, "message": { "type": "keyword" }, "bytes": { "type": "long" } } } POST test/_doc/1 { "timestamp": 1669912088.9230318, "message": "Message 1", "bytes": 250 } POST test/_doc/2 { "timestamp": 1669912088.9230319, "message": "Message 2", "bytes": 20 } ```
Closes elastic#148140 ## Summary This PR fixes time format so it can work also for epoch. Before: <img width="400" alt="Screenshot 2023-01-03 at 12 33 17" src="https://user-images.githubusercontent.com/1415710/210350243-b3ae1d1a-4c76-46e7-930f-0ca9835dc121.png"> After: <img width="400" alt="Screenshot 2023-01-03 at 12 32 49" src="https://user-images.githubusercontent.com/1415710/210350274-af80f558-6a32-4da6-9cb9-857a8cb3de70.png"> Sample data for testing: ``` PUT test PUT test/_mapping { "properties": { "timestamp": { "type": "date", "format": "epoch_second" }, "message": { "type": "keyword" }, "bytes": { "type": "long" } } } POST test/_doc/1 { "timestamp": 1669912088.9230318, "message": "Message 1", "bytes": 250 } POST test/_doc/2 { "timestamp": 1669912088.9230319, "message": "Message 2", "bytes": 20 } ``` (cherry picked from commit 1b3769c)
…8457) # Backport This will backport the following commits from `main` to `8.6`: - [[Discover] Fix field stats for epoch time format (#148288)](#148288) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2023-01-05T14:52:29Z","message":"[Discover] Fix field stats for epoch time format (#148288)\n\nCloses #148140 Summary\r\n\r\nThis PR fixes time format so it can work also for epoch.\r\n\r\nBefore:\r\n<img width=\"400\" alt=\"Screenshot 2023-01-03 at 12 33 17\"\r\nsrc=\"https://user-images.githubusercontent.com/1415710/210350243-b3ae1d1a-4c76-46e7-930f-0ca9835dc121.png\">\r\n\r\nAfter:\r\n<img width=\"400\" alt=\"Screenshot 2023-01-03 at 12 32 49\"\r\nsrc=\"https://user-images.githubusercontent.com/1415710/210350274-af80f558-6a32-4da6-9cb9-857a8cb3de70.png\">\r\n\r\nSample data for testing:\r\n```\r\nPUT test\r\nPUT test/_mapping\r\n{\r\n \"properties\": {\r\n \"timestamp\": {\r\n \"type\": \"date\",\r\n \"format\": \"epoch_second\"\r\n },\r\n \"message\": {\r\n \"type\": \"keyword\"\r\n },\r\n \"bytes\": {\r\n \"type\": \"long\"\r\n }\r\n }\r\n}\r\n \r\nPOST test/_doc/1\r\n{\r\n \"timestamp\": 1669912088.9230318,\r\n \"message\": \"Message 1\",\r\n \"bytes\": 250\r\n}\r\nPOST test/_doc/2\r\n{\r\n \"timestamp\": 1669912088.9230319,\r\n \"message\": \"Message 2\",\r\n \"bytes\": 20\r\n}\r\n```","sha":"1b3769c86b683a3e1762f23b6f503479957044c6","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:DataDiscovery","backport:prev-minor","Feature:UnifiedFieldList","v8.7.0"],"number":148288,"url":"#148288 Fix field stats for epoch time format (#148288)\n\nCloses #148140 Summary\r\n\r\nThis PR fixes time format so it can work also for epoch.\r\n\r\nBefore:\r\n<img width=\"400\" alt=\"Screenshot 2023-01-03 at 12 33 17\"\r\nsrc=\"https://user-images.githubusercontent.com/1415710/210350243-b3ae1d1a-4c76-46e7-930f-0ca9835dc121.png\">\r\n\r\nAfter:\r\n<img width=\"400\" alt=\"Screenshot 2023-01-03 at 12 32 49\"\r\nsrc=\"https://user-images.githubusercontent.com/1415710/210350274-af80f558-6a32-4da6-9cb9-857a8cb3de70.png\">\r\n\r\nSample data for testing:\r\n```\r\nPUT test\r\nPUT test/_mapping\r\n{\r\n \"properties\": {\r\n \"timestamp\": {\r\n \"type\": \"date\",\r\n \"format\": \"epoch_second\"\r\n },\r\n \"message\": {\r\n \"type\": \"keyword\"\r\n },\r\n \"bytes\": {\r\n \"type\": \"long\"\r\n }\r\n }\r\n}\r\n \r\nPOST test/_doc/1\r\n{\r\n \"timestamp\": 1669912088.9230318,\r\n \"message\": \"Message 1\",\r\n \"bytes\": 250\r\n}\r\nPOST test/_doc/2\r\n{\r\n \"timestamp\": 1669912088.9230319,\r\n \"message\": \"Message 2\",\r\n \"bytes\": 20\r\n}\r\n```","sha":"1b3769c86b683a3e1762f23b6f503479957044c6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"#148288 Fix field stats for epoch time format (#148288)\n\nCloses #148140 Summary\r\n\r\nThis PR fixes time format so it can work also for epoch.\r\n\r\nBefore:\r\n<img width=\"400\" alt=\"Screenshot 2023-01-03 at 12 33 17\"\r\nsrc=\"https://user-images.githubusercontent.com/1415710/210350243-b3ae1d1a-4c76-46e7-930f-0ca9835dc121.png\">\r\n\r\nAfter:\r\n<img width=\"400\" alt=\"Screenshot 2023-01-03 at 12 32 49\"\r\nsrc=\"https://user-images.githubusercontent.com/1415710/210350274-af80f558-6a32-4da6-9cb9-857a8cb3de70.png\">\r\n\r\nSample data for testing:\r\n```\r\nPUT test\r\nPUT test/_mapping\r\n{\r\n \"properties\": {\r\n \"timestamp\": {\r\n \"type\": \"date\",\r\n \"format\": \"epoch_second\"\r\n },\r\n \"message\": {\r\n \"type\": \"keyword\"\r\n },\r\n \"bytes\": {\r\n \"type\": \"long\"\r\n }\r\n }\r\n}\r\n \r\nPOST test/_doc/1\r\n{\r\n \"timestamp\": 1669912088.9230318,\r\n \"message\": \"Message 1\",\r\n \"bytes\": 250\r\n}\r\nPOST test/_doc/2\r\n{\r\n \"timestamp\": 1669912088.9230319,\r\n \"message\": \"Message 2\",\r\n \"bytes\": 20\r\n}\r\n```","sha":"1b3769c86b683a3e1762f23b6f503479957044c6"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
@matschaffer @jughosta This issue is still happening. I upgraded my Elastic Cloud production cluster to v8.6.0 and the issue still persists if discover:showLegacyFieldTopValues disabled: When I enable the feature flag discover:showLegacyFieldTopValues then the field data populates correctly: I have an open ticket with Elastic Support for this same issue that is still open after 2 months (01146753). |
@derek-diaz According to this comment, it looks like the fix was not merged in time for the v8.6.0 release and will instead be included in the v8.6.1 release. In the meantime, |
Ah that makes sense, the elastic support team told me that v8.6.0 had the fix. Thanks for the clarification! 👍 |
Kibana version:
8.5.x
Describe the bug:
When there's a mapping like
epoch_second
used for the timefield used in the data view, the requests returning the field statistics of Discover's field list fail:The requests for the statistics needs to have
"format": "strict_date_optional_time"
in the range to work correctlySteps to reproduce:
"timestamp": { "type": "date", "format": "epoch_second" }
No field data for the current search.
Expected behavior:
In the popover there should be a list of the Top10 field values
The text was updated successfully, but these errors were encountered: