On the WAF section of the AWS console there is a tab for "CloudWatch Log Insights" that provides a few sample queries. One of these is "Top 100 hosts".
fields @timestamp, @message
| parse @message '{"name":"Host","value":"*"}' as host
| stats count(*) as requestCount by host
| sort requestCount desc
| limit 100
This is a somewhat misleading report title for most people I expect. I find about half my traffic uses host
as opposed to Host
. I spent 30 minutes trying to make this query case insensitive when parsing that header, before giving up, and deciding to ask here.
What is the easiest way to accomplish this?