mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
16365 change clashing variable names (#17140)
* Fix: change and to and so not clashing with grafana vars (#16365) * Fix: change and to and so not clashing with grafana vars (#16365) * Fix: update now to datetime (#16365) * Fix: test should look for datetime instead of now (#16365) * Fix: _az suffix to datasource convention (#16365) * Fix: convert vars to macro, update doc (#16365) * Fix: convert vars to macro, update doc (#16365) * Fix: remove support for time vars (#16365) * Fix: confilct from master * add migration on editor open * fix migration var name
This commit is contained in:
committed by
Daniel Lee
parent
382ebd6362
commit
27874a1881
@@ -254,6 +254,10 @@ To make writing queries easier there are several Grafana macros that can be used
|
||||
`datetimeColumn ≥ datetime(2018-06-05T18:09:58.907Z) and`
|
||||
`datetimeColumn ≤ datetime(2018-06-05T20:09:58.907Z)` where the from and to datetimes are from the Grafana time picker.
|
||||
|
||||
- `$__timeFrom()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.
|
||||
|
||||
- `$__timeTo()` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.
|
||||
|
||||
- `$__escapeMulti($myVar)` - is to be used with multi-value template variables that contain illegal characters. If `$myVar` has the following two values as a string `'\\grafana-vm\Network(eth0)\Total','\\hello!'`, then it expands to: `@'\\grafana-vm\Network(eth0)\Total', @'\\hello!'`. If using single value variables there is no need for this macro, simply escape the variable inline instead - `@'\$myVar'`.
|
||||
|
||||
- `$__contains(colName, $myVar)` - is to be used with multi-value template variables. If `$myVar` has the value `'value1','value2'`, it expands to: `colName in ('value1','value2')`.
|
||||
@@ -264,8 +268,6 @@ To make writing queries easier there are several Grafana macros that can be used
|
||||
|
||||
There are also some Grafana variables that can be used in Azure Log Analytics queries:
|
||||
|
||||
- `$__from` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T18:09:58.907Z)`.
|
||||
- `$__to` - Returns the From datetime from the Grafana picker. Example: `datetime(2018-06-05T20:09:58.907Z)`.
|
||||
- `$__interval` - Grafana calculates the minimum time grain that can be used to group by time in queries. More details on how it works [here]({{< relref "reference/templating.md#interval-variables" >}}). It returns a time grain like `5m` or `1h` that can be used in the bin function. E.g. `summarize count() by bin(TimeGenerated, $__interval)`
|
||||
|
||||
### Azure Log Analytics Alerting
|
||||
|
||||
Reference in New Issue
Block a user