﻿---
title: stack kb security-ai-assistant-api find-knowledge-base-entries cli command
description: Finds Knowledge Base Entries that match the given query. 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-ai-assistant-api/find-knowledge-base-entries
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb security-ai-assistant-api find-knowledge-base-entries cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb security-ai-assistant-api find-knowledge-base-entries [options]
```

Finds Knowledge Base Entries that match the given query.
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--fields string[]">
    A list of fields to include in the response. If not provided, all fields will be included.
    **Repeatable:** pass `--fields` multiple times to supply more than one value
  </definition>
  <definition term="--filter string">
    Search query to filter Knowledge Base Entries by specific criteria.
  </definition>
  <definition term="--sort-field enum">
    Field to sort the Knowledge Base Entries by.
    **Values:** created_at, is_default, title, updated_at
  </definition>
  <definition term="--sort-order enum">
    Sort order for the results, either asc or desc.
    **Values:** asc, desc
  </definition>
  <definition term="--page number">
    Page number for paginated results. Defaults to 1.
  </definition>
  <definition term="--per-page number">
    Number of Knowledge Base Entries to return per page. Defaults to 20.
  </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>