From 577c9cd5463a0b611b11a54c941923117c2525e0 Mon Sep 17 00:00:00 2001 From: Kyle Brandt Date: Thu, 6 Aug 2020 13:16:00 -0400 Subject: [PATCH] Docs: Azure logs - cross reference field configuration display name (#26804) Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> --- docs/sources/features/datasources/azuremonitor.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/sources/features/datasources/azuremonitor.md b/docs/sources/features/datasources/azuremonitor.md index ac1d2384b96..75174d7176e 100755 --- a/docs/sources/features/datasources/azuremonitor.md +++ b/docs/sources/features/datasources/azuremonitor.md @@ -263,11 +263,13 @@ You can also select additional number value columns (with, or without multiple d ```kusto Perf | where $__timeFilter(TimeGenerated) -| summarize Samples=count(), AvgValue=avg(CounterValue) +| summarize Samples=count(), ["Avg Value"]=avg(CounterValue) by bin(TimeGenerated, $__interval), Computer, CounterName, InstanceName | order by TimeGenerated asc ``` +> **Tip**: In the above query, the Kusto syntax `Samples=count()` and `["Avg Value"]=...` is used to rename those columns — the second syntax allowing for the space. This changes the name of the metric that Grafana uses, and as a result, things like series legends and table columns will match what you specify. Here `Samples` is displayed instead of `_count`. + {{< docs-imagebox img="/img/docs/azuremonitor/logs_multi-value_multi-dim.png" class="docs-image--no-shadow" caption="Azure Logs query with multiple values and multiple dimensions" >}} ### Table queries @@ -281,6 +283,14 @@ AzureActivity | order by TimeGenerated desc ``` +### Format the display name for Log Analytics + +The default display name format is: + +`metricName{dimensionName=dimensionValue,dimensionTwoName=DimensionTwoValue}` + +This can be customized by using the [display name field configuration option]({{< relref "../../panels/field-configuration-options.md#display-name" >}}). + ### Azure Log Analytics macros To make writing queries easier there are several Grafana macros that can be used in the where clause of a query: