egress logs prints the egress filtering decisions made for an instance —
i.e. which outbound network requests were allowed or denied as your egress
policy was evaluated. This is useful when debugging why a workload can’t
reach a destination it needs, or when confirming that a policy is blocking
traffic as intended.
You can narrow the results to a time window with --after/--before, cap
how many records are returned with --limit, and choose between a
human-readable or machine-readable (json) output format.
Usage
Example
1
Create an ephemeral instance
Create an ephemeral instance and note its ID:
Output
2
View egress decisions
View the instance’s egress filtering decisions:
3
Filter egress decisions
Limit the results to a time window and format them as structured JSON:
Options
—after <timestamp>
Only show records after this timestamp, formatted as RFC3339 (e.g.2024-01-15T10:30:00Z).
—before <timestamp>
Only show records before this timestamp, formatted as RFC3339 (e.g.2024-01-15T12:00:00Z).
—limit <count>
Maximum number of egress records to return. Defaults to20000.
—output, -o <plain|json>
Output format. Supported values areplain and json; json output prints
one JSON object per line. Defaults to plain.