-
Notifications
You must be signed in to change notification settings - Fork 172
Add failed docs rule #3094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mdbirnstiehl
merged 17 commits into
elastic:main
from
mdbirnstiehl:add-failed-docs-rule
Oct 22, 2025
+178
−0
Merged
Add failed docs rule #3094
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ec67f44
add failed docs rule
mdbirnstiehl fed4af9
add failed docs rule
mdbirnstiehl 173bb2b
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl 3b1304a
add instructions
mdbirnstiehl 081137e
fix toc
mdbirnstiehl 4d3202f
add screenshot
mdbirnstiehl a863ca6
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl 1796b31
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl 4037191
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl 2578540
add tabs
mdbirnstiehl 45858e0
fix screenshot
mdbirnstiehl 41a10ac
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl c155321
fix tabs
mdbirnstiehl 71b4ea1
add review comments
mdbirnstiehl bb76043
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl 041b2bb
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl 0616970
Merge branch 'main' into add-failed-docs-rule
mdbirnstiehl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions
165
solutions/observability/incident-management/create-a-failed-docs-rule.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| --- | ||
| navigation_title: Failed docs | ||
| products: | ||
| - id: observability | ||
| - id: cloud-serverless | ||
| applies_to: | ||
| stack: ga 9.1 | ||
| serverless: ga | ||
| --- | ||
|
|
||
| # Create a failed docs rule [observability-create-failed-docs-rule] | ||
|
|
||
|
|
||
| ::::{note} | ||
|
|
||
| The **Editor** role or higher is required to create a failed docs rule using custom threshold rule. To learn more, refer to [Assign user roles and privileges](/deploy-manage/users-roles/cloud-organization/user-roles.md#general-assign-user-roles). | ||
|
|
||
| :::: | ||
|
|
||
| Create a failed docs rule using the [custom threshold rule](../incident-management/create-custom-threshold-rule.md) to alert when the number of failed documents in your data stream reaches or exceeds a given value. | ||
|
|
||
| :::{image} /solutions/images/failed-docs-rule.png | ||
| :alt: Create failed docs rule using the custom threshold rule type | ||
| :screenshot: | ||
| ::: | ||
|
|
||
| To create a failed docs rule: | ||
|
|
||
| 1. From the main menu, open the **Data Set Quality** page from **Management** → **Stack Management**, or use the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md). | ||
| 1. Find the data set you want to create a rule for in the table, and select **Open** from the **Actions** column. | ||
| 1. Select **Alerts** → **Create custom threshold rule**. If your space uses the the **Classic** solution view, you need to complete some extra steps after selecting **Alerts** before you continue. Refer to [Create a data view](#observability-create-failed-docs-data-view). | ||
| 1. Select **Add aggregation/field**. | ||
| 1. For your new aggregation, set **Aggregation type** to **Count** and **KQL Filter** to `_index : ".fs*"`. | ||
| 1. Select **Equation**, and set the equation to `(B / A) * 100`. | ||
| 1. Set **Is above** to `1.5`. | ||
| 1. Set the **Label** to `Failed docs`. | ||
| 1. Select **Next** to go to the **Details** menu. | ||
| 1. Set the **Rule name** to `Dataset quality` and add `failed_docs` to the **Tags**. | ||
| 1. Select **Create rule**. | ||
|
|
||
| ## Create a data view [observability-create-failed-docs-data-view] | ||
|
|
||
| If your space uses the **Classic** solution view, you'll need to create a data view for your rule. After selecting **Alerts** in the previous section: | ||
|
|
||
| 1. Select **Manage rules and connectors**. | ||
| 1. Select **Create rule**, then **Custom threshold**. | ||
| 1. Select **Data view**, then **Create a data view**. | ||
| 1. Find your data stream under **All sources**. | ||
| 1. Name your data view. | ||
| 1. Add your index pattern with `::failures` appended. For example, `logs-synth.2-default,logs-synth.2-default::failures`. | ||
mdbirnstiehl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 1. Select **Save data view to Kibana**. | ||
|
|
||
| After saving your data view, follow the instructions in the previous section beginning with step 4 to finish creating your failed docs rule. | ||
|
|
||
| ## Add actions [observability-create-failed-docs-alert-rule-add-actions] | ||
|
|
||
| You can extend your rules with actions that interact with third-party systems, write to logs or indices, or send user notifications. You can add an action to a rule at any time. You can create rules without adding actions, and you can also define multiple actions for a single rule. | ||
|
|
||
| To add actions to rules, you must first create a connector for that service (for example, an email or external incident management system), which you can then use for different rules, each with their own action frequency. | ||
|
|
||
| :::::{dropdown} Connector types | ||
| Connectors provide a central place to store connection information for services and integrations with third party systems. The following connectors are available when defining actions for alerting rules: | ||
|
|
||
| * [Cases](kibana://reference/connectors-kibana/cases-action-type.md) | ||
| * [D3 Security](kibana://reference/connectors-kibana/d3security-action-type.md) | ||
| * [Email](kibana://reference/connectors-kibana/email-action-type.md) | ||
| * [{{ibm-r}}](kibana://reference/connectors-kibana/resilient-action-type.md) | ||
| * [Index](kibana://reference/connectors-kibana/index-action-type.md) | ||
| * [Jira](kibana://reference/connectors-kibana/jira-action-type.md) | ||
| * [Microsoft Teams](kibana://reference/connectors-kibana/teams-action-type.md) | ||
| * [Observability AI Assistant](kibana://reference/connectors-kibana/obs-ai-assistant-action-type.md) | ||
| * [{{opsgenie}}](kibana://reference/connectors-kibana/opsgenie-action-type.md) | ||
| * [PagerDuty](kibana://reference/connectors-kibana/pagerduty-action-type.md) | ||
| * [Server log](kibana://reference/connectors-kibana/server-log-action-type.md) | ||
| * [{{sn-itom}}](kibana://reference/connectors-kibana/servicenow-itom-action-type.md) | ||
| * [{{sn-itsm}}](kibana://reference/connectors-kibana/servicenow-action-type.md) | ||
| * [{{sn-sir}}](kibana://reference/connectors-kibana/servicenow-sir-action-type.md) | ||
| * [Slack](kibana://reference/connectors-kibana/slack-action-type.md) | ||
| * [{{swimlane}}](kibana://reference/connectors-kibana/swimlane-action-type.md) | ||
| * [Torq](kibana://reference/connectors-kibana/torq-action-type.md) | ||
| * [{{webhook}}](kibana://reference/connectors-kibana/webhook-action-type.md) | ||
| * [xMatters](kibana://reference/connectors-kibana/xmatters-action-type.md) | ||
|
|
||
| ::::{note} | ||
| Some connector types are paid commercial features, while others are free. For a comparison of the Elastic subscription levels, go to [the subscription page](https://www.elastic.co/subscriptions). | ||
|
|
||
| :::: | ||
|
|
||
|
|
||
| For more information on creating connectors, refer to [Connectors](/deploy-manage/manage-connectors.md). | ||
|
|
||
| ::::: | ||
|
|
||
|
|
||
| :::::{dropdown} Action frequency | ||
| After you select a connector, you must set the action frequency. You can choose to create a summary of alerts on each check interval or on a custom interval. Alternatively, you can set the action frequency such that you choose how often the action runs (for example, at each check interval, only when the alert status changes, or at a custom action interval). In this case, you must also select the specific threshold condition that affects when actions run: `Alert`, `No Data`, or `Recovered`. | ||
|
|
||
| :::{image} /solutions/images/serverless-custom-threshold-run-when.png | ||
| :alt: Configure when a rule is triggered | ||
| :screenshot: | ||
| ::: | ||
|
|
||
| You can also further refine the conditions under which actions run by specifying that actions only run when they match a KQL query or when an alert occurs within a specific time frame: | ||
|
|
||
| * **If alert matches query**: Enter a KQL query that defines field-value pairs or query conditions that must be met for notifications to send. The query only searches alert documents in the indices specified for the rule. | ||
| * **If alert is generated during timeframe**: Set timeframe details. Notifications are only sent if alerts are generated within the timeframe you define. | ||
|
|
||
| :::{image} /solutions/images/serverless-logs-threshold-conditional-alert.png | ||
| :alt: Configure a conditional alert | ||
| :screenshot: | ||
| ::: | ||
|
|
||
| ::::: | ||
|
|
||
|
|
||
| :::::{dropdown} Action variables | ||
| Use the default notification message or customize it. You can add more context to the message by clicking the Add variable icon  and selecting from a list of available variables. | ||
|
|
||
| :::{image} /solutions/images/serverless-action-variables-popup.png | ||
| :alt: Action variables list | ||
| :screenshot: | ||
| ::: | ||
|
|
||
| The following variables are specific to this rule type. You can also specify [variables common to all rules](/explore-analyze/alerts-cases/alerts/rule-action-variables.md). | ||
|
|
||
| `context.alertDetailsUrl` | ||
| : Link to the alert troubleshooting view for further context and details. This will be an empty string if the `server.publicBaseUrl` is not configured. | ||
|
|
||
| `context.cloud` | ||
| : The cloud object defined by ECS if available in the source. | ||
|
|
||
| `context.container` | ||
| : The container object defined by ECS if available in the source. | ||
|
|
||
| `context.group` | ||
| : The array of objects containing groups that are reporting data. | ||
|
|
||
| `context.grouping` {applies_to}`stack: ga 9.1` | ||
| : The object containing groups that are reporting data. | ||
|
|
||
| `context.host` | ||
| : The host object defined by ECS if available in the source. | ||
|
|
||
| `context.labels` | ||
| : List of labels associated with the entity where this alert triggered. | ||
|
|
||
| `context.orchestrator` | ||
| : The orchestrator object defined by ECS if available in the source. | ||
|
|
||
| `context.reason` | ||
| : A concise description of the reason for the alert. | ||
|
|
||
| `context.tags` | ||
| : List of tags associated with the entity where this alert triggered. | ||
|
|
||
| `context.timestamp` | ||
| : A timestamp of when the alert was detected. | ||
|
|
||
| `context.value` | ||
| : List of the condition values. | ||
|
|
||
| `context.viewInAppUrl` | ||
| : Link to the alert source. | ||
|
|
||
| ::::: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.