Templating causes QueryParsingException in Elasticsearch

Sometimes the template variable values are null and thus resulting into blank strings in the queries to the ElasticSearch data source. This leads to the QueryParsingException[Failed to parse query [x-custom-appname:]]; nested: NotSerializableExceptionWrapper[parse_exception

Cause of the exceptions in the ElasticSearch database

  • Incorrect configuration of template variable.
  • Unable to load the template variable values due to database connectivity issue.

I found that in case of no value for the template variable, the query is given a blank string like this [x-custom-appname:]

Is there a way to handle this?


You maybe can use custom null value of template variable?


How do we set custom null value, because can find custom all value only in templating.

I meant custom all value. But maybe that don’t work for you? Give it a try,


I have already tried that but it did not work.
I have raised a issue also https://github.com/grafana/grafana/issues/10651 and shared my finding

1 Like