Forum Discussion
vadlaniganesh
Oct 03, 2022Copper Contributor
KQL query for getting average ingress data last 30 days
Please help me in writing the KQL query to get the average ingress data for last 30 days for the storage account
1 Reply
Sort By
- LukeJMaddenBrass ContributorGood morning vadlaniganesh,
You can use the Azure Monitor Logs feature in the Azure portal to write a Kusto Query Language (KQL) query to get the average ingress data for the last 30 days for your storage account. Here's an example query:
AzureMetrics
| where ResourceId contains '/providers/Microsoft.Storage/storageAccounts/'
| where MetricName == 'Ingress'
| summarize avg(Average) by bin(TimeGenerated, 1d), ResourceId
| where TimeGenerated >= ago(30d)
This query retrieves the average ingress metric for your storage account, grouped by day and storage account ID. The where clause filters the query to only include metrics for the "Ingress" metric. The summarize clause calculates the average value of the "Ingress" metric per day for the last 30 days. Finally, the where clause filters the query to only include data from the last 30 days.
You can customize this query by replacing "Ingress" with the name of the metric you want to retrieve, and adjusting the time range as needed.
Hope that helps,
Kind regards,
Luke