Open
Description
Elasticsearch Version
8.17.1
Installed Plugins
No response
Java Version
bundled
OS Version
Docker
Problem Description
(Disclaimer, I'm not 100% sure if this is a problem with ES|QL or with how Kibana handles the data returned by ES|QL)
When running a query, and using the BUCKET
function over a timestamp, if SORT
is not applied to the timestamp, data/graphs become inconsistent
Steps to Reproduce
- Run the following ES|QL query
FROM metrics-system.cpu-*
| STATS AVG(system.cpu.total.norm.pct) BY time = BUCKET(@timestamp, 30 seconds)
Note: I recommend using a "wide" time range (48 hours) seems to reproduce regularly
Observe that it will get graphed/visualized in "weird" ways:
- Run the same query, but add a
SORT
at the end
FROM metrics-system.cpu-*
| STATS AVG(system.cpu.total.norm.pct) BY time = BUCKET(@timestamp, 30 seconds)
| SORT time
Observe that the data will now graph/visualize correctly/consistently
Logs (if relevant)
No response