doctl insights logs search

Generated on 5 Nov 2026 from doctl version v2.3.0

Usage

doctl insights logs search [flags]

Description

Searches log records in a region.

Build the search with flags, or pass a complete request body with --request-file. The request file uses the JSON body of the public logs search API, as JSON or YAML. When using a request file, --limit and --cursor override the file’s pagination so you can page through results.

--from and --to accept an RFC3339 timestamp, a Unix timestamp, now, a look-back duration such as 15m or 7d, or an offset such as now-1h.

--filter and --filter-file take a JSON filter expression, for example {"condition":{"field":{"name":"service.name"},"operator":"FILTER_OPERATOR_EQ","value":{"string_value":"api"}}}. When --text is also set, both must match.

Results are returned one page at a time. Cursor pagination is only available when ordering by timestamp alone; when more results are available, the next cursor is printed to stderr in text output and returned in pagination.next_cursor in JSON output.

Example

The following example searches the last 15 minutes of logs in nyc3 for “timeout”, newest first:

doctl insights logs search --region nyc3 --from 15m --text timeout --order-by timestamp:desc

Flags

Option Description
--cursor Cursor from a previous search to retrieve the next page
--filter A JSON filter expression
--filter-file Read a JSON or YAML filter expression from path, or - to read from stdin
--format Columns for output in a comma-separated list. Possible values: Timestamp, Severity, Service, Body.
--from Start of the time range. Defaults to 1h
--help, -h Help for this command
--limit Maximum number of records to return, up to 1000. The server defaults to 100
Default: 0
--no-header Return raw data with no headers
Default: false
--order-by Sort clause in the form field[:asc|desc], for example timestamp:desc. Repeat the flag to sort by several fields
--region The region slug to query, for example nyc3 (required)
--request-file Read a complete JSON or YAML logs search request from path, or - to read from stdin
--text Search for a substring across the log body, service name, and resource URN
--to End of the time range. Defaults to now
Command Description
doctl insights logs Display commands for searching Insights logs

Global Flags

Option Description
--access-token, -t API V2 access token
--api-url, -u Override default API endpoint
--config, -c Specify a custom config file
Default:
    --context Specify a custom authentication context name
    --http-retry-max Set maximum number of retries for requests that fail with a 429 or 500-level error
    Default: 5
    --http-retry-wait-max Set the minimum number of seconds to wait before retrying a failed request
    Default: 30
    --http-retry-wait-min Set the maximum number of seconds to wait before retrying a failed request
    Default: 1
    --interactive Enable interactive behavior. Defaults to true if the terminal supports it (default false)
    Default: false
    --output, -o Desired output format [text|json]
    Default: text
    --show Reveal masked values, such as secrets, instead of hiding them. Values are unmasked automatically in CI
    Default: false
    --trace Show a log of network activity while performing a command
    Default: false
    --verbose, -v Enable verbose output
    Default: false

    We can't find any results for your search.

    Try using different keywords or simplifying your search terms.