logs

get/api/projects/{project_id}/logs/attributes/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/logs/attributes/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

attribute_type'log' | 'resource'

Type of attributes: "log" for log attributes, "resource" for resource attributes. Defaults to "log".

  • log - log
  • resource - resource
date_fromstring nullable

Start of the date range. Accepts ISO 8601 timestamps or relative formats: -7d, -1h, -1mStart, etc.

date_tostring nullable

End of the date range. Same format as date_from. Omit or null for "now".

Date range to search within. Defaults to last hour.

date_fromstring

Start of the range as a top-level parameter. The endpoint ignores it when you send dateRange.

date_tostring

End of the range as a top-level parameter. The endpoint ignores it when you send dateRange.

keystring required

Attribute key. For type "log", use "message" for the body text, or a log column: "pattern" and "pattern_version" (the patterns pivot), "severity_level", "service_name", "trace_id", "span_id". For "log_attribute"/"log_resource_attribute", use the attribute key (e.g. "k8s.container.name").

type'log' | 'log_attribute' | 'log_resource_attribute' required
  • log - log
  • log_attribute - log_attribute
  • log_resource_attribute - log_resource_attribute
operator'exact' | 'is_not' | 'icontains' | 'not_icontains' | 'starts_with' | 'not_starts_with' | 'ends_with' | 'not_ends_with' | 'regex' | 'not_regex' | 'gt' | 'lt' | 'is_date_exact' | 'is_date_before' | 'is_date_after' | 'is_set' | 'is_not_set' required
  • exact - exact
  • is_not - is_not
  • icontains - icontains
  • not_icontains - not_icontains
  • starts_with - starts_with
  • not_starts_with - not_starts_with
  • ends_with - ends_with
  • not_ends_with - not_ends_with
  • regex - regex
  • not_regex - not_regex
  • gt - gt
  • lt - lt
  • is_date_exact - is_date_exact
  • is_date_before - is_date_before
  • is_date_after - is_date_after
  • is_set - is_set
  • is_not_set - is_not_set
valueunknown

Property filters to narrow which logs are scanned for attributes.

keysstring

Comma-separated list of attribute keys. The endpoint returns only keys that exactly match an entry in the list.

limitinteger

Max results (default: 100)

offsetinteger

Pagination offset (default: 0)

searchstring

Search filter for attribute names

search_valuesboolean

When true, the search query also matches attribute values (not just keys). Each result indicates whether it matched on key or value.

serviceNamesstring[]

Filter attributes to those appearing in logs from these services.

Response

countinteger required

Total attribute keys matched (not paginated).

Changes

No recorded changes to this operation across all 1 revision of this API.