epok
View as Markdown

AWS VPC Flow Logs

Updated Nov 22, 2026 · today

VPC Flow Logs can be delivered to CloudWatch Logs, and from there to Epok through the shared setup on AWS: logs and metrics.

On this page: What you getTurn on logsMetricsUseful searchesTroubleshooting

What you get

  • Logs: each flow-log line, from the group you choose (for example /vpc/flowlogs). The line is stored as text in _msg; the fields inside it (source and destination address, port, action, bytes) are not parsed yet.
  • Metrics: none. Flow logs publish no CloudWatch metric namespace, so nothing arrives through the metric stream.

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

  1. In the VPC console, open Flow logs, choose Create flow log, and set the destination to Send to CloudWatch Logs.
  2. Pick the log group (or let AWS create it) and the IAM role. The role needs logs:CreateLogGroup, logs:CreateLogStream and logs:PutLogEvents.
  3. Add the group to EPOK_LOG_GROUPS and run the setup on AWS: logs and metrics.

Metrics

None. VPC Flow Logs do not produce CloudWatch metrics, so there is no metric namespace for this page. For traffic-level metrics, use AWS/EC2 (in the default list) or AWS/NATGateway (stream every namespace with EPOK_METRIC_NAMESPACES=all).

text
log_group:"/vpc/flowlogs" _msg:"REJECT"      # rejected traffic
log_group:"/vpc/flowlogs" _msg:"10.0.1.5"     # one source or destination address
log_group:"/vpc/flowlogs" _time:1h | stats by (_msg) count()  # top flow-log shapes

Because the line is one text value, searches use _msg: for the contents. Filtering by source address, port or action as separate fields is not supported yet.

Troubleshooting

  1. No group appears. The flow log was created with an S3 destination instead of CloudWatch Logs. S3 delivery is not supported yet; recreate the flow log with the CloudWatch Logs destination.
  2. The IAM role is refused. The role must allow logs:PutLogEvents on the group. Use the role the console offers, or add the three logs: permissions.
  3. Fields are not searchable.Expected: flow-log lines are stored as text, so search with _msg:. Parsed fields come later.

Next