Stéphane de Luca
Stéphane de Luca

Reputation: 13611

Azure Time Series Insights query: how to denote a variable such as 'cpu.thermal.average' in the query?

My series' got the value: cpu.thermal.average. I see the values in the TSI explorer for the given range of time.

By executing the following request, for "temperatures" I only get "null". I am not sure about how to write $event.cpu.thermal.average equivalent. Any idea?

    { 
        "aggregateSeries": {
        "timeSeriesId": [
          "MySeries",
        ],
        "searchSpan": {
          "from": "2021-03-10T07:00:00Z",
          "to": "2021-03-10T20:00:50Z"
        },
        "interval": "PT3600M",
        "filter": null,
        "inlineVariables": {
          "latitudes": {
            "kind": "numeric",
            "value": {
              "tsx": "$event.latitude"
            },
            "filter": null,
            "aggregation": {
              "tsx": "avg($value)"
            }
          },
          "temperatures": {
            "kind": "numeric",
            "value": {
              "tsx": "$event['cpu.thermal.average']"
            },
            "filter": null,
            "aggregation": {
              "tsx": "avg($value)"
            }
          }
        },
        "projectedVariables": [
          "latitudes",
          "temperatures"
        ]
        }
    }

enter image description here

Upvotes: 0

Views: 95

Answers (1)

asergaz
asergaz

Reputation: 1051

From here: https://learn.microsoft.com/en-us/rest/api/time-series-insights/reference-time-series-expression-syntax#value-expressions

When accessing nested properties, the Type is required.

It should work if you use $event.cpu.thermal.average.Double

Upvotes: 0

Related Questions