﻿---
title: stack kb security-osquery-api osquery-get-unified-history cli command
description: Get unified query history Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4075/reference/elastic-cli/cli/stack/kb/security-osquery-api/osquery-get-unified-history
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-osquery-api osquery-get-unified-history cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-osquery-api osquery-get-unified-history [options]
```

Get unified query history
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--page-size number">
    The number of results to return per page.
  </definition>
  <definition term="--next-page string">
    A base64-encoded cursor for pagination. Use the value from the previous response to fetch the next page.
  </definition>
  <definition term="--kuery string">
    A search string to filter history entries by pack name, query text, or query ID.
  </definition>
  <definition term="--user-ids string">
    Comma-separated list of user IDs to filter live query history.
  </definition>
  <definition term="--source-filters string">
    Comma-separated list of source types to include. Valid values are `live`, `rule`, and `scheduled`.
  </definition>
  <definition term="--start-date string">
    The start of the time range filter (ISO 8601).
  </definition>
  <definition term="--end-date string">
    The end of the time range filter (ISO 8601).
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>