xdr_count
Count records in an XDR section, optionally filtered by query, to measure matching alerts, incidents, assets, or other data.
Instructions
Get the total count of records in an XDR section. Optionally filter by query to count matching records only. For application_versions this counts per-asset records, not distinct version strings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query string using field:value syntax, e.g. 'resolved : "false" AND severity : "critical"'. Pass an empty string to list the whole section unfiltered — deliberately, since that can be a very large number of records. Fields can be combined with AND, OR, AND NOT, OR NOT and grouped with parentheses. A string value may contain * as a wildcard, in any position: name : "VDI-5*", file_name : "*.exe", domain : "*corp*". Without a wildcard a string value must match exactly. Numeric and date fields do not take wildcards. Call xdr_get_mapping for the fields a section accepts, xdr_get_filters for the values an enumerated field takes, and xdr_get_suggestions to look up the exact spelling of a value — a value outside the accepted set returns zero results rather than an error. Time filtering uses fields from xdr_get_mapping, typically timestamp, with relative (timestamp >= now-1d, now-6h) or absolute values (timestamp >= "2024-01-01T00:00:00.000+03:00"). The calendar-rounding forms now/d, now/w and now/M return nothing, so use now-1d and the like. Note that timestamp is a search field: the ordering parameter takes an entirely different set of names. For the "applications" section, filter by asset, e.g. (asset: "<machine_id>"). The "application_versions" section returns per-asset software version records. Filter by software_id: "<uuid from applications>" (supported even though absent from mapping), version: "1.2.3", or asset: "<machine_id or exact current_name>" identifying a single asset. For dates in this section use first_seen or last_seen, e.g. last_seen >= now-7d; ordering uses version, ts_created or ts_updated. A query the API cannot parse is not rejected — it is treated as free text, so verify that the results match what you asked for. (optional) | |
| section | Yes | Section name, one of: alerts, incidents, emails, files, events, connections, assets, modules, audit, applications, application_versions |