Skip to content

Commit f6805be

Browse files
committed
[E&A] Refines Watcher.
1 parent 094b0e3 commit f6805be

File tree

6 files changed

+45
-90
lines changed

6 files changed

+45
-90
lines changed

explore-analyze/alerts-cases/watcher.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,43 @@ mapped_urls:
99

1010
# Watcher
1111

12-
% What needs to be done: Lift-and-shift
12+
::::{tip}
13+
{{kib}} Alerting provides a set of built-in actions and alerts that are integrated with applications such as APM, Metrics, Security, and Uptime. You can use {{kib}} Alerting to detect complex conditions within different {{kib}} apps and trigger actions when those conditions are met. For more information, see [Alerting and actions](../alerts-cases.md).
14+
::::
1315

14-
% Use migrated content from existing pages that map to this page:
16+
You can use Watcher to watch for changes or anomalies in your data and perform the necessary actions in response. For example, you might want to:
1517

16-
% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/xpack-alerting.md
17-
% - [ ] ./raw-migrated-files/cloud/cloud/ec-watcher.md
18-
% - [ ] ./raw-migrated-files/kibana/kibana/watcher-ui.md
19-
% - [ ] ./raw-migrated-files/docs-content/serverless/elasticsearch-differences.md
20-
% - [ ] ./raw-migrated-files/kibana/kibana/secure-reporting.md
18+
* Monitor social media as another way to detect failures in user-facing automated systems like ATMs or ticketing systems. When the number of tweets and posts in an area exceeds a threshold of significance, notify a service technician.
19+
* Monitor your infrastructure, tracking disk usage over time. Open a helpdesk ticket when any servers are likely to run out of free space in the next few days.
20+
* Track network activity to detect malicious activity, and proactively change firewall configuration to reject the malicious user.
21+
* Monitor Elasticsearch, and send immediate notification to the system administrator if nodes leave the cluster or query throughput exceeds an expected range.
22+
* Track application response times and if page-load time exceeds SLAs for more than 5 minutes, open a helpdesk ticket. If SLAs are exceeded for an hour, page the administrator on duty.
23+
24+
All of these use-cases share a few key properties:
25+
26+
* The relevant data or changes in data can be identified with a periodic Elasticsearch query.
27+
* The results of the query can be checked against a condition.
28+
* One or more actions are taken if the condition is true — an email is sent, a 3rd party system is notified, or the query results are stored.
29+
30+
## How watches work [_how_watches_work]
31+
32+
The {{alert-features}} provide an API for creating, managing and testing *watches*. A watch describes a single alert and can contain multiple notification actions.
33+
34+
A watch is constructed from four simple building blocks:
35+
36+
Schedule
37+
: A schedule for running a query and checking the condition.
38+
39+
Query
40+
: The query to run as input to the condition. Watches support the full Elasticsearch query language, including aggregations.
41+
42+
Condition
43+
: A condition that determines whether or not to execute the actions. You can use simple conditions (always true), or use scripting for more sophisticated scenarios.
44+
45+
Actions
46+
: One or more actions, such as sending email, pushing data to 3rd party systems through a webhook, or indexing the results of the query.
47+
48+
A full history of all watches is maintained in an Elasticsearch index. This history keeps track of each time a watch is triggered and records the results from the query, whether the condition was met, and what actions were taken.
2149

2250
% Internal links rely on the following IDs being on this page (e.g. as a heading ID, paragraph ID, etc):
2351

raw-migrated-files/cloud/cloud/ec-watcher.md renamed to explore-analyze/alerts-cases/watcher/enable-watcher.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# Enable Watcher [ec-watcher]
1+
# Enable Watcher [enable-watcher]
22

33
::::{note}
44
If you are looking for Kibana alerting, check [Alerting and Actions](../../../explore-analyze/alerts-cases.md) in the Kibana Guide.
55
::::
66

7-
87
Watcher lets you take action based on changes in your data. It is designed around the principle that, if you can query something in Elasticsearch, you can alert on it. Simply define a query, condition, schedule, the actions to take, and Watcher will do the rest.
98

109
Watcher can be enabled when configuring your cluster. You can run Alerting on a separate cluster from the cluster whose data you are actually watching.
1110

12-
13-
## Before you begin [ec_before_you_begin_8]
11+
## Before you begin [watcher-before-you-begin]
1412

1513
Some restrictions apply when adding alerts. To learn more, check [Restrictions for alerts (via Watcher)](../../../deploy-manage/deploy/elastic-cloud/restrictions-known-problems.md#ec-restrictions-watcher).
1614

@@ -20,8 +18,7 @@ To enable Watcher on a cluster, you may first need to perform one or several of
2018

2119
To learn more about Kibana alerting and how to use it, check [Alerting and Actions](../../../explore-analyze/alerts-cases.md).
2220

23-
24-
## Send alerts by email [ec-watcher-allowlist]
21+
## Send alerts by email [watcher-allowlist]
2522

2623
Alerting can send alerts by email. You can configure notifications similar to the [operational emails](../../../deploy-manage/cloud-organization/operational-emails.md) that Elasticsearch Service sends automatically to alert you about performance issues in your clusters.
2724

@@ -31,8 +28,7 @@ You can optionally add [HTML sanitization](../../../explore-analyze/alerts-cases
3128

3229
For more information on sending alerts by email, check [Email action](../../../explore-analyze/alerts-cases/watcher/actions-email.md).
3330

34-
35-
## Cloud email service limits [ec-cloud-email-service-limits]
31+
## Cloud email service limits [cloud-email-service-limits]
3632

3733
The following quotas apply when using the Elastic email service:
3834

@@ -41,11 +37,9 @@ The following quotas apply when using the Elastic email service:
4137
* Maximum message size (including attachments): 10 MB per message (after base64 encoding).
4238
* The email-sender can’t be customized (Any custom `From:` header will be removed)
4339

40+
## Advanced usage [advanced_usage]
4441

45-
## Advanced usage [ec_advanced_usage]
46-
47-
48-
### Slack and PagerDuty integration [ec-advanced-usage]
42+
### Slack and PagerDuty integration [advanced-usage]
4943

5044
Under the hood, Alerting is configured through `elasticsearch.yml`. If you want to customize your Alerting settings, you can provide custom `elasticsearch.yml` snippet which is appended to your configuration.
5145

@@ -81,7 +75,6 @@ xpack.notification.slack:
8175
to: channel3
8276
```
8377

84-
8578
### Slack Webhook account settings [slack-webhook-setting]
8679

8780
The Slack Webhook is set for each account in the Elasticsearch Keystore with the following settings:
@@ -135,8 +128,7 @@ PUT _watcher/watch/test-alarm
135128
:alt: Advanced Alerting configuration
136129
:::
137130

138-
139-
## Configuring a custom mail server [ec-watcher-custom-mail-server]
131+
## Configuring a custom mail server [watcher-custom-mail-server]
140132

141133
It is possible to use a custom mail service instead of the one configured by default. It can be configured by following the [Elasticsearch documentation for configuring email accounts](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html).
142134

@@ -169,4 +161,3 @@ An example on how to configure a new account from the Elastic cloud console:
169161
6. The new email account is now set up. It will now be used by default for watcher email actions.
170162

171163
For a full reference of all available settings, see the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/notification-settings.html#email-notification-settings).
172-

raw-migrated-files/kibana/kibana/watcher-ui.md renamed to explore-analyze/alerts-cases/watcher/watcher-ui.md

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Watcher [watcher-ui]
1+
# Watcher UI [watcher-ui]
22

33
Watcher is an {{es}} feature that you can use to create actions based on conditions, which are periodically evaluated using queries on your data. Watches are helpful for analyzing mission-critical and business-critical streaming data. For example, you might watch application logs for performance outages or audit access logs for security threats.
44

@@ -17,8 +17,6 @@ Go to the **Watcher** page using the navigation menu or the [global search field
1717
There are limitations in **Watcher** that affect {{kib}}. For information, refer to [Alerting](../../../explore-analyze/alerts-cases/watcher/watcher-limitations.md).
1818
::::
1919

20-
21-
2220
## Watcher security [watcher-security]
2321

2422
To use Watcher in {{kib}}, you must have the built-in `kibana_admin` role and either of these Watcher roles:
@@ -32,15 +30,12 @@ To manage roles, go to the **Roles** management page, or use the [role APIs](htt
3230
If you are creating a threshold watch, you must also have the `view_index_metadata` index privilege. See [Index management](../../../manage-data/lifecycle/index-lifecycle-management/index-management-in-kibana.md) for detailed information.
3331
::::
3432

35-
36-
3733
## Create a threshold alert [watcher-create-threshold-alert]
3834

3935
A threshold alert is one of the most common types of watches that you can create. This alert periodically checks when your data is above, below, equals, or is in between a certain threshold within a given time interval.
4036

4137
The following example walks you through creating a threshold alert. The alert is triggered when the maximum total CPU usage on a machine goes above a certain percentage. The example uses [Metricbeat](https://www.elastic.co/products/beats/metricbeat) to collect metrics from your systems and services. [Learn more](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-installation-configuration.html) on how to install and get started with Metricbeat.
4238

43-
4439
### Define the watch input and schedule [_define_the_watch_input_and_schedule]
4540

4641
1. Click **Create** and then select **Create threshold alert**.
@@ -53,8 +48,6 @@ The following example walks you through creating a threshold alert. The alert is
5348

5449
![Input and schedule for threshold alert](../../../images/kibana-create-threshold-alert-created.png "")
5550

56-
57-
5851
### Add a condition [_add_a_condition]
5952

6053
You should now see a panel with default conditions and a visualization of the data based on those conditions. The condition evaluates the data you’ve loaded into the watch and determines if any action is required.
@@ -70,8 +63,6 @@ You should now see a panel with default conditions and a visualization of the da
7063

7164
![Condition for threshold alert](../../../images/kibana-threshold-alert-condition.png "")
7265

73-
74-
7566
### Add an action [_add_an_action]
7667

7768
Now that the condition is set, you must add an action. The action triggers when the watch condition is met. For a complete list of actions and how to configure them, see [Adding conditions to actions](../../../explore-analyze/alerts-cases/watcher/action-conditions.md).
@@ -89,18 +80,14 @@ In this example, you’ll configure an email action. You must have an [email acc
8980

9081
The alert appears on the Watcher overview page, where you can drill down into the watch history and status.
9182

92-
93-
9483
### Delete the alert [_delete_the_alert]
9584

9685
In this example, you set the threshold to 25% so you can see the watch execute its actions. In a real-world scenario, this threshold is likely too low because the alerts will be too frequent. Once you are done experimenting, you should delete the alert. Find the alert on the Watcher overview page and click the trash icon in the **Actions** column.
9786

98-
9987
### Edit the alert [_edit_the_alert]
10088

10189
Alternatively, you can keep the alert and adjust the threshold value. To edit an alert, find the alert on the Watcher overview page and click the pencil icon in the **Actions** column.
10290

103-
10491
## View watch history and status [watcher-getting-started]
10592

10693
The Watcher overview page lists your watches, including the state of each watch, when its condition was last met, when the condition was last checked, and whether any of its actions have been acknowledged, throttled, or failed to execute. Each watch can be in one of three states:
@@ -111,41 +98,35 @@ The Watcher overview page lists your watches, including the state of each watch,
11198

11299
From this page you can drill down into a watch to investigate its history and status.
113100

114-
115101
### View watch history [_view_watch_history]
116102

117103
The **Execution history** tab shows each time the watch is triggered and the results of the query, whether the condition was met, and what actions were taken.
118104

119105
![Execution history tab](../../../images/kibana-execution-history.png "")
120106

121-
122107
### Acknowledge action status [_acknowledge_action_status]
123108

124109
The **Action statuses** tab lists all actions associated with the watch and the state of each action. Some actions can be acknowledged, which will prevent too many executions of that action for the relevant watch. See [Acknowledgement and throttling](../../../explore-analyze/alerts-cases/watcher/actions.md#actions-ack-throttle) for details.
125110

126111
![Action status tab](../../../images/kibana-alerts-status.png "")
127112

128-
129113
## Deactivate and delete a watch [watcher-deactivate]
130114

131115
Actions for deactivating and deleting a watch are on each watch detail page:
132116

133117
* **Deactivate a watch** if you know a situation is planned that will cause a false alarm. You can reactivate the watch when the situation is resolved.
134118
* **Delete a watch** to permanently remove it from the system. You can delete the watch you are currently viewing, or go to the Watcher overview, and delete watches in bulk.
135119

136-
137120
## Create an advanced watch [watcher-create-advanced-watch]
138121

139122
Advanced watches are for users who are more familiar with {{es}} query syntax and the Watcher framework. The UI is aligned with using the REST APIs. For more information, see [Query DSL](../../../explore-analyze/query-filter/languages/querydsl.md).
140123

141-
142124
### Create the watch [_create_the_watch]
143125

144126
On the Watch overview page, click **Create** and choose **Create advanced watch**. An advanced watch requires a name and ID. Name is a user-friendly way to identify the watch, and ID refers to the identifier used by {{es}}. Refer to [Watch definition](../../../explore-analyze/alerts-cases/watcher/how-watcher-works.md#watch-definition) for how to input the watch JSON.
145127

146128
![Create advanced watch](../../../images/kibana-advanced-watch-create.png "")
147129

148-
149130
### Simulate the watch [_simulate_the_watch]
150131

151132
The **Simulate** tab allows you to override parts of the watch, and then run a simulation. Be aware of these implementation details on overrides:
@@ -161,11 +142,9 @@ After starting the simulation, you’ll see a results screen. For more informati
161142

162143
![Create advanced watch](../../../images/kibana-advanced-watch-simulate.png "")
163144

164-
165145
### Examples of advanced watches [_examples_of_advanced_watches]
166146

167147
Refer to these examples for creating an advanced watch:
168148

169149
* [Watch the status of an {{es}} cluster](../../../explore-analyze/alerts-cases/watcher/watch-cluster-status.md)
170150
* [Watch event data](https://www.elastic.co/guide/en/elasticsearch/reference/current/watching-meetup-data.html)
171-

explore-analyze/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ toc:
359359
children:
360360
- file: alerts-cases/watcher/watcher-getting-started.md
361361
- file: alerts-cases/watcher/how-watcher-works.md
362+
- file: alerts-cases/watcher/enable-watcher.md
363+
- file: alerts-cases/watcher/watcher-ui.md
362364
- file: alerts-cases/watcher/encrypting-data.md
363365
- file: alerts-cases/watcher/input.md
364366
children:

raw-migrated-files/elasticsearch/elasticsearch-reference/xpack-alerting.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

raw-migrated-files/toc.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ toc:
244244
- file: cloud/cloud/ec-traffic-filtering-vpc.md
245245
- file: cloud/cloud/ec-upgrade-deployment.md
246246
- file: cloud/cloud/ec-user-privileges.md
247-
- file: cloud/cloud/ec-watcher.md
248247
- file: cloud/cloud/ec-working-with-elasticsearch.md
249248
- file: curator/elasticsearch-client-curator/index.md
250249
children:
@@ -639,7 +638,6 @@ toc:
639638
- file: elasticsearch/elasticsearch-reference/snapshots-restore-snapshot.md
640639
- file: elasticsearch/elasticsearch-reference/starting-elasticsearch.md
641640
- file: elasticsearch/elasticsearch-reference/stopping-elasticsearch.md
642-
- file: elasticsearch/elasticsearch-reference/xpack-alerting.md
643641
- file: elasticsearch/elasticsearch-reference/xpack-autoscaling.md
644642
- file: elasticsearch/elasticsearch-reference/xpack-rollup.md
645643
- file: ingest-docs/fleet/index.md
@@ -684,7 +682,6 @@ toc:
684682
- file: kibana/kibana/upgrade-migrations-rolling-back.md
685683
- file: kibana/kibana/upgrade.md
686684
- file: kibana/kibana/using-kibana-with-security.md
687-
- file: kibana/kibana/watcher-ui.md
688685
- file: kibana/kibana/xpack-security-authorization.md
689686
- file: kibana/kibana/xpack-security-fips-140-2.md
690687
- file: kibana/kibana/xpack-security.md

0 commit comments

Comments
 (0)