> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# nsc egress logs

Print egress filtering decisions for an instance.

`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

```bash theme={null}
nsc egress logs [instance-id] [--after <timestamp>] [--before <timestamp>] [--limit <count>] [-o <plain|json>]
```

### Example

<Steps titleSize="h4">
  <Step title="Create an ephemeral instance">
    Create an ephemeral instance and note its ID:

    ```bash theme={null}
    nsc create
    ```

    ```text nocopy Output theme={null}
    Created instance "1lf2ol9ioulce"
     deadline: 2023-04-25T13:24:53Z
    ```
  </Step>

  <Step title="View egress decisions">
    View the instance's egress filtering decisions:

    ```bash theme={null}
    nsc egress logs 1lf2ol9ioulce
    ```
  </Step>

  <Step title="Filter egress decisions">
    Limit the results to a time window and format them as structured JSON:

    ```bash theme={null}
    nsc egress logs 1lf2ol9ioulce --after 2024-01-15T10:30:00Z --before 2024-01-15T12:00:00Z -o json
    ```
  </Step>
</Steps>

## Options

<h3 id="--after-timestamp">
  \--after \<timestamp>
</h3>

Only show records after this timestamp, formatted as RFC3339 (e.g.
`2024-01-15T10:30:00Z`).

<h3 id="--before-timestamp">
  \--before \<timestamp>
</h3>

Only show records before this timestamp, formatted as RFC3339 (e.g.
`2024-01-15T12:00:00Z`).

<h3 id="--limit-count">
  \--limit \<count>
</h3>

Maximum number of egress records to return. Defaults to `20000`.

<h3 id="--output--o-plainjson">
  \--output, -o \<plain|json>
</h3>

Output format. Supported values are `plain` and `json`; `json` output prints
one JSON object per line. Defaults to `plain`.
