Docs: Update formatting-multi-value-variables.md (#29547)

This commit is contained in:
Diana Payton 2020-12-02 12:03:45 -08:00 committed by GitHub
parent 24086c63a3
commit df1b0a1daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,9 @@
+++
title = "Formatting multi-value variables"
title = "Multi-value variables"
weight = 600
+++
# Formatting multi-value variables
# Multi-value variables
Interpolating a variable with multiple values selected is tricky as it is not straight forward how to format the multiple values into a string that is valid in the given context where the variable is used. Grafana tries to solve this by allowing each data source plugin to inform the templating interpolation engine what format to use for multiple values.
@ -21,7 +21,7 @@ InfluxDB and Prometheus use regex expressions, so the same variable would be int
Elasticsearch uses lucene query syntax, so the same variable would be formatted as `("host1" OR "host2" OR "host3")`. In this case, every value must be escaped so that the value only contains lucene control words and quotation marks.
## Formatting troubles
## Troubleshoot multi-value variables
Automatic escaping and formatting can cause problems and it can be tricky to grasp the logic behind it. Especially for InfluxDB and Prometheus where the use of regex syntax requires that the variable is used in regex operator context.