grafana/public
yenalsnavaj f830d8772a
Variables: Adds named capture groups to variable regex (#28625)
* Dashboard: Add named capture groups to variable query regex

Variable query regex are able to use 'text' and 'value' named capture
groups to allow for separate display text to be extracted from the
query result. e.g.

Using a regex of /foo="(?<text>[^"]+)|bar="(?<value>[^"]+)/g on a query
result of metric{foo="FOO", bar="BAR"} would result in the variable
value being set to 'BAR' but display text being set to 'FOO'

Resolves #21076

* Improve regex capture group documentation

* Update docs/sources/variables/filter-variables-with-regex.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>

* Use text capture if value capture does not match

This is to keep the behaviour consistent with the current behavior. See
discussion https://github.com/grafana/grafana/pull/28625/files#r516490942

* Improve regex field placeholder and tooltip message

To make the feature more discoverable to users the place holder example
now includes the named capture groups. The tool tip message also
includes a reference and link to the documentation.

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2020-11-04 09:31:38 +01:00
..
app Variables: Adds named capture groups to variable regex (#28625) 2020-11-04 09:31:38 +01:00
dashboards Chore: MEGA - Make Eslint Great Again 💅 (#26094) 2020-08-11 17:52:44 +02:00
emails change the year in email templates (#26507) 2020-07-23 10:25:39 +03:00
fonts Chore: fix modes for non-executable files (#16864) 2019-05-03 09:51:53 +02:00
img AddDatasource: Improve plugin categories (#28584) 2020-10-28 08:15:32 +01:00
sass Events: Remove unused or unnecessary events (#28783) 2020-11-03 15:29:43 +01:00
test Transformations: Use Observable (#27584) 2020-10-06 07:55:09 +02:00
vendor Fix typos (#28074) 2020-10-07 11:29:30 +01:00
views Failed to load application files message improvement (#26214) 2020-09-07 10:53:13 +03:00
robots.txt add support for robots.txt file 2015-06-15 19:02:38 -04:00