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

# stack kb security-osquery-api osquery-export-scheduled-query-results cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-osquery-api osquery-export-scheduled-query-results \
  --schedule-id <schedule-id> \
  --execution-count <execution-count> \
  --format <format> \
  [options]
```

Export scheduled query results
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--schedule-id string required">
    The schedule ID of the scheduled query.
  </definition>
  <definition term="--execution-count string required">
    The execution counter for the scheduled query run whose results are exported. Must be a non-negative integer.
  </definition>
  <definition term="--format enum required">
    The output format of the exported file.
    **Values:** ndjson, json, csv
  </definition>
  <definition term="--body string">
  </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>