# Viewing and downloading audit logs

Having a record of all the changes over time in your Managed Nebula network is crucial information to have at your fingertips if you ever need to troubleshoot a problem or investigate a potential security incident, which is why Managed Nebula includes easily-accessible and detailed [audit logs](/docs/glossary/audit-log/). This guide will describe the information captured in audit logs and explain how to download a .csv file of your logs for further analysis.

## Access audit logs via the admin panel

To access your Managed Nebula logs, visit the [Logs](https://admin.defined.net/logs/audit) page in the admin panel. You will see a reverse time-ordered list of activities that have occurred in your account, starting with the most recent at the top. Click on any row to expand it and see more details about the actual change that occurred, including the target of the change and its state before and after the change.

![Audit Logs page showing a "Host created" record](./open-audit-log-row-showing-a-host-created.png)

Note that you can filter the types of logs shown from the dropdown in the top right of the page. This will filter by target type. For example, if you’d like to only see changes to hosts, you can choose “Hosts”, or if you would only like to view authentications into Defined Networking, you can choose “Users”:

![Open dropdown on the Audit Logs page, selecting the Users type](./filtering-audit-logs-on-user-type.png)

If you would like to dig a bit deeper into the logs, you can download a .csv file and open it in a spreadsheet editor like Microsoft Excel or Google Sheets. The export can be filtered down to a specific type (it will default to the same filter being used on the page as described above), and a timeframe up to the previous 90 days can be chosen. If you require more than 90 days of audit logs, contact support, and we will be happy to provide them.

![Export CSV modal open with filter and time frame options](./export-csv-modal-with-filter-and-time-frame-options.png)

After choosing your options and clicking the “Export CSV” button, you will be given a “Download” button, which will allow you to save the file to your computer.

![Loading complete for the Export CSV modal, with a `Download your logs!` button](./loading-completed-download-your-logs-now.png)

## Access audit logs via the API

With our API access, you can create an API key with the `audit-logs:list` scope and retrieve audit logs using the format documented in [List audit logs](/docs/api/operations/auditlogslist/).

### Export audit logs to a SIEM

To continuously copy audit logs into a SIEM or data lake, poll [List audit logs](/docs/api/operations/auditlogslist/) in back-to-back time windows using `filter.since` and `filter.until`:

1. For each poll, request the logs from the end of the previous window up to one minute ago. For the first poll, start wherever you want your history to begin.
2. Follow `metadata.nextCursor` with the same filters until `metadata.hasNextPage` is `false`.
3. Save the `filter.until` you used. It becomes the `filter.since` of the next window.

```bash
since="2026-11-05T13:00:00Z" # the until of the previous window
until="$(date -u -d '1 minute ago' +%Y-%m-%dT%H:%M:%SZ)" # macOS: date -u -v-1M +%Y-%m-%dT%H:%M:%SZ

curl -H "Authorization: Bearer $DN_API_KEY" \
  "https://api.defined.net/v1/audit-logs?filter.since=$since&filter.until=$until&sortDirection=asc&pageSize=500"
```

This fetches the first page of the window. Repeat it with `&cursor=` set to `metadata.nextCursor` until `metadata.hasNextPage` is `false`, as in step 2.

`filter.since` includes logs at exactly that time, and `filter.until` excludes them. As a result, back-to-back windows never return the same log twice and never skip one between them.

Each log is timestamped when a change begins. It appears in the API when the change finishes, usually a fraction of a second later. Ending each window a minute in the past gives in-progress changes time to finish, so their logs are in place before you read that window. Polling every few minutes is plenty.

Use UTC timestamps ending in `Z`. If you send a timestamp with an offset such as `+02:00`, URL-encode it, because `+` in a query string is read as a space.
