You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The template variable returns a blank string in case of no possible output for a query, the Grafana makes a query to Elasticsearch is follows:
“query”:"ApplicationId:() AND Scope:()"
This leads to following exception in the elasticsaerch logs and on grafana console
{
_ “type”: “query_parsing_exception”,_
_ “reason”: “Failed to parse query [ApplicationId:() AND Scope:()]”,_
_ “index”: “appversiondetails”,_
_ “line”: 1,_
_ “col”: 213_
_ },_
The js file actually returns blank string in case of None or no output. Is it possible to handle this scenario or atleast provide a configuration where we can set some default value.
Currently to suppress such exceptions, I modify the js file.
Detail of the Issue
I was going through the Grafana Files for this issue and found the below code snippets in the boot.js file which plays an important role in the queries done to the elasticsearch:
return{text:“None”,value:"",isNone:!0}
AND
this.luceneFormat=function(n){return"string"==typeof n?t(n):"("+e.map(n,function(e){return’"’+t(e)+’"’}).join(" OR “)+”)"}
Possible Action
For rectifying this issue we can modify the JS file and define the queries that are fired to the ElasticSearch database.
Please help. I do not want to have a workaround for this issue because after upgrading Grafana I face the same issue and then need to do the fix again because of change in the boot.js.
The text was updated successfully, but these errors were encountered:
torkelo
changed the title
Elasticsearch parse_exception when Grafana template variable return blank string
Template variable: Custom value for none value
Jan 29, 2018
Hello,
We have the same need but for a prometheus datasource.
I like the edit on the issue name. We could re-use the same code/UI as defining the "Custom All Value" for a "Custom None Value".
Yeah, I agree it would be nice to be able to specify a few custom values that variable values could always include. Then it'd be easy to achieve this by just adding a custom value using special character that never appear in variable values.
hugohaggmark
changed the title
Template variable: Custom value for none value
[FeatureRequest] Variables - Add custom value for the "None" value
Nov 11, 2020
This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!
The template variable returns a blank string in case of no possible output for a query, the Grafana makes a query to Elasticsearch is follows:
“query”:"ApplicationId:() AND Scope:()"
This leads to following exception in the elasticsaerch logs and on grafana console
{
_ “type”: “query_parsing_exception”,_
_ “reason”: “Failed to parse query [ApplicationId:() AND Scope:()]”,_
_ “index”: “appversiondetails”,_
_ “line”: 1,_
_ “col”: 213_
_ },_
The js file actually returns blank string in case of None or no output. Is it possible to handle this scenario or atleast provide a configuration where we can set some default value.
Currently to suppress such exceptions, I modify the js file.
Detail of the Issue
I was going through the Grafana Files for this issue and found the below code snippets in the boot.js file which plays an important role in the queries done to the elasticsearch:
return{text:“None”,value:"",isNone:!0}
AND
this.luceneFormat=function(n){return"string"==typeof n?t(n):"("+e.map(n,function(e){return’"’+t(e)+’"’}).join(" OR “)+”)"}
Possible Action
For rectifying this issue we can modify the JS file and define the queries that are fired to the ElasticSearch database.
return{text:“None”,value:“none”,isNone:!0}
AND
this.luceneFormat = function© {
if (“string” == typeof c) return a©;
var d = b.map(c, function(b) {
return ‘"’ + a(b) + ‘"’
});
if(d.length != 0) return “(” + d.join(" OR ") + “)”;
else return “none”;
Information:
https://community.grafana.com/t/templating-causes-queryparsingexception-in-elasticsearch/3040
https://community.grafana.com/t/elasticsearch-parse-exception-when-grafana-template-variable-return-blank-string/5053
Please help. I do not want to have a workaround for this issue because after upgrading Grafana I face the same issue and then need to do the fix again because of change in the boot.js.
The text was updated successfully, but these errors were encountered: