﻿---
title: stack kb apm-annotations get-annotation cli command
description: Search for annotations 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/apm-annotations/get-annotation
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb apm-annotations get-annotation cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb apm-annotations get-annotation \
  --service-name <service-name> \
  [options]
```

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

## Options

<definitions>
  <definition term="--service-name string required">
    The name of the service
  </definition>
  <definition term="--environment string">
    The environment to filter annotations by
  </definition>
  <definition term="--start string">
    The start date for the search
  </definition>
  <definition term="--end string">
    The end date for the search
  </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>