# Export Query Logs
## Endpoint
`/api/logs/export`
**Obsolete Path:** (none documented)
## Method
GET
## Description
Queries DNS query logs from a specified installed DNS app and exports the full result set as a downloadable CSV file. Unlike the Query Logs endpoint, this does **not** support pagination -- it exports all matching entries in one file.
## Authentication
Required. A valid session `token` from `login` or `createToken`.
**Permission:** Logs: View
## Parameters
| `token` | string | Yes | No | Session token generated by `login` or `createToken`. |
| `node` | string | No | No | The node domain name to target. Only usable when Clustering is initialized. When unspecified, the current node is used. |
| `name` | string | Yes | No | The name of the installed DNS app to query logs from. |
| `classPath` | string | Yes | No | The class path of the DNS app. |
| `start` | string | No | No | Start date/time filter in ISO 8601 format (e.g. `yyyy-MM-dd HH:mm:ss`). Only entries on or after this timestamp are included. |
| `end` | string | No | No | End date/time filter in ISO 8601 format (e.g. `yyyy-MM-dd HH:mm:ss`). Only entries on or before this timestamp are included. |
| `clientIpAddress` | string | No | No | Filter by client IP address. |
| `protocol` | string (enum) | No | No | Filter by DNS transport protocol. Valid values: `Udp`, `Tcp`, `Tls`, `Https`, `Quic`. |
| `responseType` | string (enum) | No | No | Filter by DNS server response type. Valid values: `Authoritative`, `Recursive`, `Cached`, `Blocked`, `UpstreamBlocked`, `CacheBlocked`. |
| `rcode` | string | No | No | Filter by DNS response code (e.g. `NoError`, `NxDomain`, `ServerFailure`). |
| `qname` | string | No | No | Filter by query name (QNAME) in the request question section. |
| `qtype` | string | No | No | Filter by DNS resource record type (QTYPE) in the request question section (e.g. `A`, `AAAA`, `CNAME`, `MX`). |
| `qclass` | string | No | No | Filter by DNS class (QCLASS) in the request question section (e.g. `IN`). |
## Response Fields
This endpoint does **not** return JSON. The response is a downloadable CSV file with:
| `Content-Type` | `text/csv` |
| `Content-Disposition` | `attachment` |
The body is CSV-formatted text containing all matching log entries. The exact CSV columns are not documented but are expected to mirror the fields from the Query Logs endpoint (`timestamp`, `clientIpAddress`, `protocol`, `responseType`, `rcode`, `qname`, `qtype`, `qclass`, `answer`, etc.).
## Conditional Logic Notes
- The `name` and `classPath` parameters are **both required** and must identify a valid installed DNS app that supports query logging.
- Unlike the Query Logs endpoint (`/api/logs/query`), this endpoint does **not** accept `pageNumber`, `entriesPerPage`, or `descendingOrder` parameters. All matching entries are exported in a single CSV file.
- All filter parameters are independently optional and can be combined. When multiple filters are specified, they are applied conjunctively (AND logic).
- The `start` and `end` parameters form an inclusive date range filter. Either, both, or neither can be provided independently.
- The `protocol` parameter accepts exactly one of the five enum values; behavior with invalid values is not documented.
- The `responseType` parameter accepts exactly one of the six enum values; behavior with invalid values is not documented.
- The `node` parameter is only meaningful when Clustering is initialized.
- No obsolete path is documented for this endpoint, suggesting it was added after the API path restructuring.
## Edge Cases
- Since this endpoint returns all matching entries without pagination, large date ranges or unfiltered queries could produce very large CSV files, potentially causing timeouts or memory issues.
- The response is a file download (not JSON), so standard JSON error handling does not apply. HTTP status codes should be checked for errors.
- The date/time format uses `yyyy-MM-dd HH:mm:ss` (with a space), which requires URL encoding of the space character when sent as a query parameter.
- The `rcode` parameter is a free-form string (not a restricted enum in the docs), so any valid DNS RCODE name could be used.
- The exact CSV column headers and format are not documented; they may vary depending on the DNS app being queried.
- If no entries match the filter criteria, the response may be an empty CSV (headers only) or a zero-length file -- behavior is not explicitly specified.