> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/integrations/inbound-integrations/opensearch.md).

# OpenSearch Integration

Create alerts in ilert from OpenSearch monitor alerts — with ilert's OpenSearch inbound integration.

[OpenSearch](https://opensearch.org/) is an open-source search, analytics, and observability suite. Its Alerting plugin lets you monitor your data and trigger actions when conditions are met. With this integration, alerts raised by OpenSearch monitors automatically create alerts in ilert, so the right responders are notified and escalations happen reliably.

## In ilert: Create an OpenSearch alert source <a href="#create-alert-source" id="create-alert-source"></a>

1. Go to **Alerting** → **Alert sources** and click **Create new alert source**.
2. Search for **OpenSearch**, click its tile, and click **Next**.
3. Give your alert source a name, optionally assign teams, and click **Next**.
4. Choose who gets notified: select **Use existing escalation policy** and pick a policy, or **Generate new escalation policy** to start with a basic one that notifies you first. Click **Next**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-8a281bf3931f5a1a531951ce97984d50989dd875%2Falert-source-escalation-step.png?alt=media" alt="The escalation step of the ilert alert source wizard, headed Who should be notified about alerts, with an escalation policy selected and a preview of its escalation rules below."><figcaption><p>Pick an existing escalation policy, or generate a basic one without leaving the wizard.</p></figcaption></figure>
5. Select **Default grouping** and click **Continue setup**. It groups events by the alert key the integration sets; the other [grouping options](/alerting/configure-alerting/alert-sources.md#event-grouping) are easier to judge once events are arriving.
6. The next page shows more settings, such as notification priority and alert templates. Click **Finish setup** for now; you can change them later.
7. On the final page, ilert generates a webhook URL for your alert source. Copy it — you will need it in the next section.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-d144f4c110340d375a9548e042c3678cd6beaa68%2Fopensearch-url.png?alt=media" alt=""><figcaption></figcaption></figure>

## In OpenSearch: Create a notification channel <a href="#create-channel" id="create-channel"></a>

1. Click the **side menu** button.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-d59fef0260e0c49d5f1683fa6f7d26e4c07ca617%2Fopensearch-1.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Scroll down and click on **Notifications**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-d89d7c5caacf183dc7bce0b3729eae9d0419be97%2Fopensearch-2.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Click on **Create channel**.
4. Give the channel a **name**, choose **Custom webhook** as the channel type, and paste the webhook URL you copied from ilert into the **Webhook URL** field.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-f6afe9c646b6c8f6500236ca68e676a59696157d%2Fopensearch-3.png?alt=media" alt=""><figcaption></figcaption></figure>

## In OpenSearch: Create a monitor and action <a href="#create-monitor" id="create-monitor"></a>

1. Click the **side menu** button again and choose **Alerting**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-a9ceead855d805610fa8de74c9bd03a5488d356d%2Fopensearch-4.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Click on **Monitors**, then **Create monitor**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-87d7a66679f025ebb04c4657c18f8ae0d30a20a8%2Fopensearch-5.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Fill in the monitor details as needed, then click **Add action**.
4. Give your action a **name**, choose the **channel** you just created, and copy and paste the template below into the message box.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-644764a404b138b0a1702a12709ba9fd48c3f9c2%2Fopensearch-6.png?alt=media" alt=""><figcaption></figcaption></figure>
5. Click **Create**. You are done.

### Payload template

```json
{
  "monitor_name": "{{ctx.monitor.name}}",
  "monitor_type": "{{ctx.monitor.monitor_type}}",
  "trigger_name": "{{ctx.trigger.name}}",
  "trigger_id": "{{ctx.trigger.id}}",
  "severity": "{{ctx.trigger.severity}}",
  "period_start": "{{ctx.periodStart}}",
  "period_end": "{{ctx.periodEnd}}",
  "alert_id": "{{ctx.alert.id}}",
  "alert_version": "{{ctx.alert.version}}",
  "alert_state": "{{ctx.alert.state}}",
  "alert_error_message": "{{ctx.alert.error_message}}",
  "alert_acknowledged_time": "{{ctx.alert.acknowledged_time}}",
  "action_name": "{{ctx.action.name}}"
}
```

When a monitor's trigger fires, OpenSearch runs the action and posts this payload to ilert, which creates an alert.

## FAQ

#### **Will alerts in ilert be resolved automatically?**

Yes. ilert uses the `alert_state` field from the payload: when it is **COMPLETED** or **DELETED** (the trigger condition is no longer met), the corresponding ilert alert is resolved automatically.

#### **Is this integration bidirectional?**

No. The integration is one-directional: OpenSearch sends alerts to ilert. Acknowledging or resolving an alert in ilert is not synced back to OpenSearch, and vice versa.

#### **Can I connect OpenSearch with multiple alert sources in ilert?**

Yes. Create an additional notification channel in OpenSearch for each alert source and point it at that alert source's webhook URL, then reference the channel from the relevant monitor actions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ilert.com/integrations/inbound-integrations/opensearch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
