Forum Discussion
Help requested with log analytics query for Application Gateway timechart
- May 30, 2018
Hi Bart,
If I understand your question correctly, you're looking for the bin() command. I've also cleaned up the rest of your query to be more performant. Try to avoid "search" whenever possible to improve your query times; in this case, since you know the table name and column names where your data is, filter by them directly.
AzureDiagnostics | where ResourceType == "APPLICATIONGATEWAYS" and Resource == "mygateway" | where clientIP_s == "1.1.1.1" | summarize count() by bin(TimeGenerated, 1h) | render timechart
Note that while I'm using "1h" here as the size of bucket which you want to examine, I could just as easily say "2m" (2 minute buckets), "30s" (30 seconds), etc.
Thanks,
-Evgeny
Hi Bart,
If I understand your question correctly, you're looking for the bin() command. I've also cleaned up the rest of your query to be more performant. Try to avoid "search" whenever possible to improve your query times; in this case, since you know the table name and column names where your data is, filter by them directly.
AzureDiagnostics | where ResourceType == "APPLICATIONGATEWAYS" and Resource == "mygateway" | where clientIP_s == "1.1.1.1" | summarize count() by bin(TimeGenerated, 1h) | render timechart
Note that while I'm using "1h" here as the size of bucket which you want to examine, I could just as easily say "2m" (2 minute buckets), "30s" (30 seconds), etc.
Thanks,
-Evgeny
- Bart VerbovenMay 31, 2018Copper Contributor
Wonderful!
This indeed returns the information that I'm looking for
Thanks,
Regards,
Bart