Managelogs
manageLogsRetrieve, clear, or download NextDNS profile query logs. Filter recent entries with limits or raw mode, export retained logs as CSV for review or troubleshooting.
Instructions
Manage query logs for a NextDNS profile.
Operations:
- get: Return recent query log entries (use limit to cap results).
Set raw=true to bypass deduplication/noise filtering.
- clear: Delete all stored logs for the profile.
- download: Download retained logs as CSV. from_time and to_time are
ignored by the NextDNS download endpoint. The CSV is streamed to a
temporary file; only the file path, size, row count, and a small
capped preview are returned (the full text is never inlined).
A hard total-size cap bounds how much is streamed to disk (the
NEXTDNS_DOWNLOAD_MAX_BYTES environment variable, default 1 GiB);
a download that would exceed it is aborted mid-stream and the
partial file is removed. On success the temp
file is not cleaned up: the CSV stays in the OS temp directory
(mode 0600) and the returned path is the only record of it, so
delete it when it is no longer needed. Failed downloads do remove
the temp file and its parent directory.
Time values can be Unix timestamps or relative strings like -1d or -7d.
They are only used by get.
limit is clamped server-side to the range 1-1000 entries for get
(the range accepted by the NextDNS API): values above 1000 are reduced to
1000 and non-positive values to 1. The clamp is silent, so ask for at
most 1000.
Examples:
- get recent: manageLogs(operation="get", profile_id="abc123", limit=10)
- get raw logs: manageLogs(operation="get", profile_id="abc123", raw=true)
- download: manageLogs(operation="download", profile_id="abc123", from_time="-1d")
- clear: manageLogs(operation="clear", profile_id="abc123")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | ||
| user | No | ||
| limit | No | ||
| device | No | ||
| to_time | No | ||
| from_time | No | ||
| operation | Yes | ||
| profile_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||