# Kibana

[<mark style="color:blue;">Kibana</mark>](https://www.elastic.co/kibana/) is a free and open user interface that lets you visualize your Elasticsearch data and navigate the Elastic Stack.

Route detailed alerts from Kibana to the right users in Squadcast.

## How to integrate Kibana with Squadcast

### In Squadcast: Using Kibana as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media&#x26;token=aaca6610-9d18-4dd4-9cf5-320042f326f1" alt="Add Kibana as an alert source in Squadcast"><figcaption></figcaption></figure>

2\. Select **Kibana**. Copy the displayed **Webhook URL** to [configure](#in-kibana-create-a-squadcast-webhook-alert) it within **Kibana**. Finish by clicking **Add Alert Source** -> **Done.**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4f32bf468ba7fed885ed22413120647a8c180445%2FKibana.png?alt=media\&token=2c72e543-41c4-4d6c-9ec1-3ceceacc3212)

{% hint style="warning" %}
**Important:**

When an alert source turns Active, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source. An Alert Source is active if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In Kibana: Create a Squadcast webhook alert

1. From the navigation bar on the left, select **Management** and then, select **Stack Management**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-ee1de3a8dbbbec17eb425ace4809d3f2ed66cdb4%2Fkibana_2.png?alt=media)

2. Select **Alerts and Insights** -> **Rules and Connectors**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-ecdbc4e109c23ca7453cfe3a4c88c25293433e06%2Fkibana_3.png?alt=media)

3. Navigate to **Connectors** and click on **Create Connector.**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b57d70af6a396e1d1e0fa0639ae8ae13f5c83801%2Fkibana_4.png?alt=media)

4. Select **Webhook** as a Connector.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-01b8655f8a9cc121db7ad5088895bbbfb101d05c%2Fkibana_5.png?alt=media\&token=7f13fef6-f9c7-4227-a1bd-e53af2594ab6)

5. Provide a name for **Connector name**, choose **Method** as `POST` and paste the previously copied Squadcast Webhook URL in the **URL** field. Click on **Save.**\
   \
   Furthermore, please activate the **Add HTTP header** slider. Enter the header with the following content: `content-type: application/json`. Finally, click on the **Save** button.

<figure><img src="https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b68aee91b0add47c6a4978dae344c003ffc3a2f7%2Fb5a8a610-b176-11ee-8461-c54cabb198da.avif?alt=media" alt="" width="352"><figcaption></figcaption></figure>

6. Head over to **Rules** and click on **Create Rules**. Provide a name for the rule and select any of the options from the supported rule scenarios: **(a)** APM AND USER EXPERIENCE **(b)** LOGS **(c)** MACHINE LEARNING **(d)** METRICS **(e)** UPTIME
7. Select **Webhook** in the **Action** section.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b07e35500120f00b4d3085a02e355a0beae232b7%2Fkibana_7.png?alt=media) ![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-712977389fd592629e3cd83f00c1221bd14c6856%2Fkibana_8.png?alt=media\&token=c003ada5-51a9-4183-b7e6-d7d11f3b4768)

8. Next, select the previously created Connector in the **Webhook connector** drop-down and paste the below **JSON** in the placeholder for **Body** and click on **Save**

```json
{
    "actionGroupName": "{{alert.actionGroupName}}",
    "actionSubgroup": "{{alert.actionSubgroup}}",
    "alert_id": "{{alert.id}}",
    "actionGroup": "{{alert.actionGroup}}",
    "conditions": "{{context.conditions}}",
    "denominatorConditions": "{{context.denominatorConditions}}",
    "group": "{{context.group}}",
    "isRatio": "{{context.isRatio}}",
    "matchingDocuments": "{{context.matchingDocuments}}",
    "numeratorConditions": "{{context.numeratorConditions}}",
    "ratio": "{{context.ratio}}",
    "timestamp": "{{context.timestamp}}",
    "date": "{{date}}",
    "kibanaBaseUrl": "{{kibanaBaseUrl}}",
    "rule_id": "{{rule.id}}",
    "name": "{{rule.name}}",
    "spaceId": "{{rule.spaceId}}",
    "tags": "{{rule.tags}}",
    "type": "{{rule.type}}",
    "environment": "{{context.environment}}",
    "serviceName": "{{context.serviceName}}",
    "threshold": "{{context.threshold}}",
    "transactionType": "{{context.transactionType}}",
    "triggerValue": "{{context.triggerValue}}",
    "interval": "{{context.interval}}",
    "isInterim": "{{context.isInterim}}",
    "jobIds": "{{context.jobIds}}",
    "message": "{{context.message}}",
    "score": "{{context.score}}",
    "topInfluencers": "{{context.topInfluencers}}",
    "topRecords": "{{context.topRecords}}",
    "anomalyExplorerUrl": "{{context.anomalyExplorerUrl}}",
    "timestampIso8601": "{{context.timestampIso8601}}",
    "results": "{{context.results}}",
    "metric": "{{context.metric}}",
    "reason": "{{context.reason}}",
    "value": "{{context.value}}",
    "alertState": "{{context.alertState}}",
    "currentTriggerStarted": "{{state.currentTriggerStarted}}",
    "firstCheckedAt": "{{state.firstCheckedAt}}",
    "firstTriggeredAt": "{{state.firstTriggeredAt}}",
    "isTriggered": "{{state.isTriggered}}",
    "lastCheckedAt": "{{state.lastCheckedAt}}",
    "lastResolvedAt": "{{state.lastResolvedAt}}",
    "lastTriggeredAt": "{{state.lastTriggeredAt}}",
    "latestErrorMessage": "{{state.latestErrorMessage}}",
    "monitorId": "{{state.monitorId}}",
    "monitorName": "{{state.monitorName}}",
    "monitorType": "{{state.monitorType}}",
    "monitorUrl": "{{state.monitorUrl}}",
    "observerHostname": "{{state.observerHostname}}",
    "observerLocation": "{{state.observerLocation}}",
    "statusMessage": "{{state.statusMessage}}",
    "downMonitorsWithGeo": "{{context.downMonitorsWithGeo}}",
    "agingCommonNameAndDate": "{{state.agingCommonNameAndDate}}",
    "agingCount": "{{state.agingCount}}",
    "count": "{{state.count}}",
    "expiringCommonNameAndDate": "{{state.expiringCommonNameAndDate}}",
    "expiringCount": "{{state.expiringCount}}"
}
```

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-d3db7162f1c465e55805ec39e9759766793d1216%2Fkibana_9.png?alt=media)

That is it, you are now good to go!

* Whenever an alert is generated in Kibana, an incident will be created in Squadcast.
* For any queries, please reach out to our Support team and they will be happy to assist you with your Kibana queries.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*


---

# Agent Instructions: 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:

```
GET https://support.squadcast.com/integrations/alert-source-integrations-native/kibana.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
