Kusto\KQL - Render timechart for simple count value
Asked Answered
C

1

7

I have a kql-query which calculates number of uploaded BLOBS in Azure storage since last 24 hours. The query blow returns a number as expected when run in Azure log analytics.

StorageBlobLogs
| where TimeGenerated > ago(1d) and OperationName has "PutBlob" and StatusText contains "success" a
| distinct Uri
| summarize count()

I want now to visualise this information in a timechart to get some detailed view. Have tried to add "render timechart" to the query chain as follows

StorageBlobLogs
| where TimeGenerated > ago(1d) and OperationName has "PutBlob" and StatusText contains "success" a
| distinct Uri
| summarize count()
| render timechart

When executing the query however, i am getting the error message;

Failed to create visualization The Stacked bar chart can't be created as you are missing a column of one of the following types: int, long, decimal or real

Any tips to how this can be accomplished?

Carthusian answered 1/7, 2021 at 20:35 Comment(0)
B
14

if you wish to look at the data aggregated at an hourly resolution (for example) and rendered as a timechart, you could try this:

StorageBlobLogs
| where TimeGenerated > ago(1d) and OperationName has "PutBlob" and StatusText contains "success"
| summarize dcount(Uri) by bin(TimeGenerated, 1h)
| render timechart
Bobsleigh answered 1/7, 2021 at 21:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.