Open tiny-pangolin opened 4 days ago
Hi @tiny-pangolin ! The pie charts, by default, use stats
query type, and in this case, the query goes through stats API.
In the stats API, we can't use the top
command.
{\"status\":\"error\",\"errorType\":\"422\",\"error\":\"the \\\"top 2\\\" pipe cannot be put after \\\"stats by (_time:20s) count(*) as \\\\\\\"count\\\\\\\"\\\" pipe in the query [* | stats by (_time:20s) count(*) as \\\"count\\\" | top 2]\"}"
I think this issue will be fixed when we implement the switch with different query types for different types of panels. Please check this issue.
Dashboard visualizations fail with a 422 error when using the top pipe to limit the amount of values even using a stats before the top pipe. Currently the workaround is to let Grafana limit the number of results shown to the user.
example of a query that returns an error:
fixed query: