{"action":"closed","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/13721","repository_url":"https://api.github.com/repos/grafana/grafana","labels_url":"https://api.github.com/repos/grafana/grafana/issues/13721/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/13721/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/13721/events","html_url":"https://github.com/grafana/grafana/issues/13721","id":371265685,"node_id":"MDU6SXNzdWUzNzEyNjU2ODU=","number":13721,"title":"[wip]Feat/Fix - Support Elasticsearch Lucene queries in template variables (Textbox)","user":{"login":"davewat","id":35579731,"node_id":"MDQ6VXNlcjM1NTc5NzMx","avatar_url":"https://avatars0.githubusercontent.com/u/35579731?v=4","gravatar_id":"","url":"https://api.github.com/users/davewat","html_url":"https://github.com/davewat","followers_url":"https://api.github.com/users/davewat/followers","following_url":"https://api.github.com/users/davewat/following{/other_user}","gists_url":"https://api.github.com/users/davewat/gists{/gist_id}","starred_url":"https://api.github.com/users/davewat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davewat/subscriptions","organizations_url":"https://api.github.com/users/davewat/orgs","repos_url":"https://api.github.com/users/davewat/repos","events_url":"https://api.github.com/users/davewat/events{/privacy}","received_events_url":"https://api.github.com/users/davewat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-17T21:02:37Z","updated_at":"2018-10-18T12:10:48Z","closed_at":"2018-10-18T12:10:48Z","author_association":"CONTRIBUTOR","body":"Please include this information:\r\n### What Grafana version are you using? 5.3.0\r\n### What datasource are you using? Elasticsearch\r\n### What OS are you running grafana on? CentOS 7.4\r\n### What did you do? Lucene query in Textbox template variable\r\n### What was the expected result? Proper query to data source, same as if typed in Metric tab\r\n### What happened instead? regex slash-a-thon all over the query \r\n \r\nI (and likely anyone else using an Elasticsearch datasource) have always needed to be able to provide a Lucene Query via a Template Variable, so it could be used to update multiple panels in a single dashboard.  The value of this working properly unlocks a lot of potential for Elasticsearch data sources.\r\n\r\nThe new Textbox variable gets half the job done, but there is code that regexes (unnecessarily to my eye) the Lucene query IF it's in a template variable.  Blame seems to indicate that it was added for Jest support, but that doesn't seem right.\r\n\r\nI've tested this many different ways, and simply removing the code (one line) fixes the issue, and gives full Lucene support to the dashboard as a Template Variable.  @torkelo may know what it is for, and if it is truly needed, or can just be removed, or I can work on something that includes a dependency that I couldn't find.\r\n\r\nScreen shots below show:\r\n- the Metric Query working with an inline provided Lucene query.  Query Inspector shows the proper Lucene expression passed.\r\n- the Metric Query with the Textbox template variable.  Query Inspector shows the regexed, backslashed (unnecessarily) broken Lucene expression passed.  And the result is failure (returns all basically).\r\n- the Metric Query with the Textbox template variable. Query Inspector shows the proper Lucene expression passed, and the proper results.\r\n\r\nNeeds review.\r\n\r\n![elastic_1](https://user-images.githubusercontent.com/35579731/47115804-acd80680-d22d-11e8-91d2-84d7b729c59e.png)\r\n![elastic_2](https://user-images.githubusercontent.com/35579731/47115814-b2cde780-d22d-11e8-939c-7ad27fce4bd3.png)\r\n![elastic_3](https://user-images.githubusercontent.com/35579731/47115817-b5304180-d22d-11e8-85a9-651b4b34cc2c.png)\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"torkelo"}}