-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Labels
Description
Testing on 6.6.0.
Consider using SQL to query for a 1-minute histogram, e.g. across a default metricbeat index (and the default time field, @timestamp).
GET /_xpack/sql?format=txt
{
"query": """
SELECT HISTOGRAM("@timestamp", INTERVAL 1 MINUTE) AS h FROM "metricbeat-*" GROUP BY h
"""
}
This correctly returns. However, when omitting GROUP BY ... as in:
GET /_xpack/sql?format=txt
{
"query": """
SELECT HISTOGRAM("@timestamp", INTERVAL 1 MINUTE) FROM "metricbeat-*"
"""
}
We get:
{
"error": {
"root_cause": [
{
"type": "sql_illegal_argument_exception",
"reason": "Unknown output attribute HISTOGRAM(@timestamp){g->2644358}#2644358"
}
],
"type": "sql_illegal_argument_exception",
"reason": "Unknown output attribute HISTOGRAM(@timestamp){g->2644358}#2644358"
},
"status": 500
}
We should clean up the error here so it's easier for a user to understand what they've done wrong.