﻿---
title: stack kb saved-objects get-saved-objects-find cli command
description: Search for saved objects Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4493/reference/elastic-cli/cli/stack/kb/saved-objects/get-saved-objects-find
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb saved-objects get-saved-objects-find cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb saved-objects get-saved-objects-find --type <type> [options]
```

Search for saved objects
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--type string[] required">
    The saved object type or types to search for. Use multiple `type` values to search across types.
    **Repeatable:** pass `--type` multiple times to supply more than one value
  </definition>
  <definition term="--per-page number">
    The number of items per page.
  </definition>
  <definition term="--page number">
    The page index to return.
  </definition>
  <definition term="--search string">
    A text search string.
  </definition>
  <definition term="--default-search-operator enum">
    The boolean operator to use when combining multiple values.
    **Values:** OR, AND
  </definition>
  <definition term="--search-fields string[]">
    The fields to search on.
    **Repeatable:** pass `--search-fields` multiple times to supply more than one value
  </definition>
  <definition term="--sort-field string">
    The field to sort on.
  </definition>
  <definition term="--has-reference string">
    Return only saved objects that have a reference to the specified saved object(s).
    **Repeatable:** pass `--has-reference` multiple times to supply more than one value
  </definition>
  <definition term="--has-reference-operator enum">
    The boolean operator to use when combining multiple values.
    **Values:** OR, AND
  </definition>
  <definition term="--has-no-reference string">
    Return only saved objects that do not have a reference to the specified saved object(s).
    **Repeatable:** pass `--has-no-reference` multiple times to supply more than one value
  </definition>
  <definition term="--has-no-reference-operator enum">
    The boolean operator to use when combining multiple values.
    **Values:** OR, AND
  </definition>
  <definition term="--fields string[]">
    The fields to return for each saved object.
    **Repeatable:** pass `--fields` multiple times to supply more than one value
  </definition>
  <definition term="--filter string">
    A KQL filter to apply to the search.
  </definition>
  <definition term="--aggs string">
    Aggregations as a JSON string.
  </definition>
  <definition term="--namespaces string[]">
    The namespaces (spaces) to search in.
    **Repeatable:** pass `--namespaces` multiple times to supply more than one value
  </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>
  <definition term="--no-validate">
    skip input validation and send the request as-is
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--output-fields string">
    comma-separated list of fields to include in output (dot-notation supported)
  </definition>
  <definition term="--output-template string">
    Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
  </definition>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>