Forum Discussion
Porter76
Sep 22, 2023Brass Contributor
Help with a query to count
Trying to create a query that will count all of the diffrent ruleid's over the past week but having a hard time. Any help appreciated. Thanks!
Porter76
Sep 25, 2023Brass Contributor
Thanks so much Clive, that worked like a charm.
Is it possible to create an alert in log analytics whenever the count for a particular WAF rule being triggered exceeds a certain threshold in a given time frame?
i.e. if the count for "AWSManagedRulesAnonymousIpList" was typically 1000 in an hour and spiked to 15000, how can I alert on this?
Clive_Watson
Sep 25, 2023Bronze Contributor
AWSCloudTrail
| where TimeGenerated > ago(1h)
//| summarize count() by EventSource
| count
| where Count > 1000or
AWSCloudTrail
| where TimeGenerated > ago(1d)
| summarize countPerHour=count() by EventSource, bin(TimeGenerated,1h)
| where countPerHour > 1000
- Porter76Sep 26, 2023Brass ContributorThanks Clive, could you explain the difference bewteen the 2 here? How would I apply this to a specific ruleid?