AWS WAF logs and metrics
Updated Nov 22, 2026 · today
AWS WAF can deliver web ACL logs to CloudWatch Logs, and publishes metrics under the AWS/WAFV2 namespace. Both can reach Epok through the shared setup on AWS: logs and metrics.
On this page: What you getTurn on logsMetricsUseful searchesTroubleshooting
What you get
- Logs: each web ACL log entry, from a group like
aws-waf-logs-<name>. The entry is JSON that is stored as text in_msg; the fields inside it (rule, action, terminating rule) are not parsed yet. - Metrics: the
AWS/WAFV2namespace, which includes allowed, blocked and counted requests.
Each event also gets _time, a level detected from words in the line, service (the last part of the group name), log_group, log_stream, cloud.provider, cloud.account_id and cloud.region.
Turn on logs
- In the WAF & Shield console, open the web ACL, choose Logging and metrics, then Enable logging.
- Set the log destination to CloudWatch Logs and pick or create the log group.
- Add the group to
EPOK_LOG_GROUPSand run the setup on AWS: logs and metrics.
Metrics
The namespace is AWS/WAFV2. It is not in the default metric stream list, so to receive it run the metrics setup with EPOK_METRIC_NAMESPACES=all (streams every namespace; check the cost first).
Useful searches
log_group:aws-waf-logs-* _msg:"BLOCK" # blocked requests (prefix match on the group)
log_group:aws-waf-logs-* _msg:"XSS" # a specific rule family
log_group:aws-waf-logs-* _time:1h | stats by (log_group) count() # entries per web ACLBecause each entry is one text value, searches use _msg: for the contents. Filtering by rule name or action as separate fields is not supported yet.
Troubleshooting
- No group appears. Logging is off, or the destination was set to S3 or Kinesis Data Firehose instead of CloudWatch Logs. Reopen Logging and metrics and choose CloudWatch Logs.
- Fields are not searchable.Expected: WAF entries are stored as text, so search with
_msg:. Parsed fields come later. - Metrics missing.
AWS/WAFV2is not in the default list. Confirm you ran the metrics setup withEPOK_METRIC_NAMESPACES=all, then runbash aws-metrics.sh --verify-only.
Next
- AWS: logs and metrics: the one CloudFormation stack this page feeds into.
- VPC Flow Logs: the other log that arrives through CloudWatch Logs.