user878980
user878980

Reputation: 226

Kusto\KQL - Render timechart for simple count value

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?

Upvotes: 7

Views: 14273

Answers (1)

Yoni L.
Yoni L.

Reputation: 25995

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

Upvotes: 14

Related Questions