Skip to content

[FEATURE] Add storage_tier flag to logs command #56

@swarajrao

Description

@swarajrao

Is your feature request related to a problem?

pup logs defaults to standard indexed logs. It is not possible to query over Flex logs at the moment. Both pup logs search (v1 API) and pup logs list (v2 API) return empty results for logs stored in the Flex storage tier, even when the same query returns results in the Datadog UI.
For example:

pup logs list --query="service:abc-service source:application_logs" --from="5m"
# Returns: { "data": [], "meta": ... }

The same query in the Datadog Log Explorer UI returns results — the logs exist in the application-logs index under datadog_storage_tier:flex.

Describe the solution you'd like

Add a --storage_tier flag to pup logs list and pup logs search that maps to https://docs.datadoghq.com/api/latest/logs/#search-logs in the Datadog v2 Logs Search API.

The v2 API already supports this in the request body under filter.storage_tier. pup logs list already uses the v2 API but does not expose this parameter.

Describe alternatives you've considered

N/A

Additional context

All our application logs are Flex storage. Currently pup is not able to query any of our application logs and we need to fallback to the V2 API to make curl requests.

Proposed command syntax (if applicable)

# Query flex storage logs
pup logs list --query="service:home-api-service" --from="10m" --storage_tier="flex"

# Query standard indexed logs (current default behavior, unchanged)
pup logs list --query="service:home-api-service" --from="10m" --storage_tier="indexes"

# Omitting --storage defaults to "indexes" for backwards compatibility
pup logs list --query="service:home-api-service" --from="10m"```

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions