Skip to content

Commit 9fccfd9

Browse files
committed
[E&A] Checks intro pieces and inputs.
1 parent 967c47a commit 9fccfd9

File tree

10 files changed

+22
-92
lines changed

10 files changed

+22
-92
lines changed

explore-analyze/alerts-cases/watcher.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mapped_urls:
1010
# Watcher
1111

1212
::::{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).
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, refer to [Alerts and Cases](../alerts-cases.md).
1414
::::
1515

1616
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:
@@ -46,17 +46,3 @@ Actions
4646
: One or more actions, such as sending email, pushing data to 3rd party systems through a webhook, or indexing the results of the query.
4747

4848
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.
49-
50-
% Internal links rely on the following IDs being on this page (e.g. as a heading ID, paragraph ID, etc):
51-
52-
$$$watcher-create-advanced-watch$$$
53-
54-
$$$ec-cloud-email-service-limits$$$
55-
56-
$$$ec-watcher-custom-mail-server$$$
57-
58-
$$$watcher-create-threshold-alert$$$
59-
60-
$$$watcher-deactivate$$$
61-
62-
$$$watcher-getting-started$$$

explore-analyze/alerts-cases/watcher/enable-watcher.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# Enable Watcher [enable-watcher]
22

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

7-
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.
8-
97
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.
108

119
## Before you begin [watcher-before-you-begin]
@@ -20,7 +18,7 @@ To learn more about Kibana alerting and how to use it, check [Alerting and Actio
2018

2119
## Send alerts by email [watcher-allowlist]
2220

23-
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.
21+
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.
2422

2523
Watcher in Elastic Cloud is preconfigured with an email service and can be used without any additional configuration. Alternatively, a custom mail server can be configured as described in [Configuring a custom mail server](../../../explore-analyze/alerts-cases/watcher.md#ec-watcher-custom-mail-server)
2624

explore-analyze/alerts-cases/watcher/encrypting-data.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ To encrypt sensitive data in {{watcher}}:
1313

1414
1. Use the [elasticsearch-syskeygen](https://www.elastic.co/guide/en/elasticsearch/reference/current/syskeygen.html) command to create a system key file.
1515
2. Copy the `system_key` file to all of the nodes in your cluster.
16-
17-
::::{important}
18-
The system key is a symmetric key, so the same key must be used on every node in the cluster.
19-
::::
16+
::::{important}
17+
The system key is a symmetric key, so the same key must be used on every node in the cluster.
18+
::::
2019

2120
3. Set the [`xpack.watcher.encrypt_sensitive_data` setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/notification-settings.html):
2221

@@ -34,8 +33,6 @@ To encrypt sensitive data in {{watcher}}:
3433

3534
5. Delete the `system_key` file on each node in the cluster.
3635

37-
::::{note}
36+
::::{note}
3837
Existing watches are not affected by these changes. Only watches that you create after following these steps have encryption enabled.
3938
::::
40-
41-

explore-analyze/alerts-cases/watcher/input-chain.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/elasticsearch/reference/current/input-chain.html
55
---
66

7-
8-
97
# Chain input [input-chain]
108

11-
129
Use the `chain` input to load data from multiple sources into the watch execution context when the watch is triggered. The inputs in a chain are processed in order and the data loaded by an input can be accessed by the subsequent inputs in the chain.
1310

1411
The `chain` input enables you to perform actions based on data from multiple sources. You can also use the data collected by one input to load data from another source.
@@ -43,12 +40,10 @@ For example, the following chain input loads data from an HTTP server using the
4340
1. The inputs in a chain are specified as an array to guarantee the order in which the inputs are processed. (JSON does not guarantee the order of arbitrary objects.)
4441
2. Loads the `path` set by the `first` input.
4542

46-
4743
## Accessing chained input data [_accessing_chained_input_data]
4844

4945
To reference data loaded by a particular input, you use the input’s name, `ctx.payload.<input-name>.<value>`.
5046

51-
5247
## Transforming chained input data [_transforming_chained_input_data]
5348

5449
In certain use-cases the output of the first input should be used as input in a subsequent input. This requires you to do a transform, before you pass the data on to the next input.

explore-analyze/alerts-cases/watcher/input-http.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/elasticsearch/reference/current/input-http.html
55
---
66

7-
8-
97
# HTTP input [input-http]
108

11-
129
Use the `http` input to submit a request to an HTTP endpoint and load the response into the watch execution context when the watch is triggered. See [HTTP input attributes](#http-input-attributes) for all of the supported attributes.
1310

1411
With the `http` input, you can:
@@ -48,7 +45,6 @@ You can use the full Elasticsearch [Query DSL](../../query-filter/languages/quer
4845
}
4946
```
5047

51-
5248
## Calling Elasticsearch APIs [_calling_elasticsearch_apis]
5349

5450
To load the data from other Elasticsearch APIs, specify the API endpoint as the `path` attribute. Use the `params` attribute to specify query string parameters. For example, the following `http` input calls the [cluster stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html) API and enables the `human` attribute:
@@ -70,8 +66,6 @@ To load the data from other Elasticsearch APIs, specify the API endpoint as the
7066

7167
1. Enabling this attribute returns the `bytes` values in the response in human readable format.
7268

73-
74-
7569
## Calling external web services [input-http-auth-basic-example]
7670

7771
You can use `http` input to get data from any external web service. The `http` input supports basic authentication. For example, the following input provides a username and password to access `myservice`:
@@ -131,8 +125,6 @@ You can also call an API using a `Bearer token` instead of basic authentication.
131125
}
132126
```
133127

134-
135-
136128
## Using templates [_using_templates_2]
137129

138130
The `http` input supports templating. You can use [templates](how-watcher-works.md#templates) when specifying the `path`, `body`, header values, and parameter values.
@@ -152,7 +144,6 @@ For example, the following snippet uses templates to specify what index to query
152144
}
153145
```
154146

155-
156147
## Accessing the HTTP response [_accessing_the_http_response]
157148

158149
If the response body is formatted in JSON or YAML, it is parsed and loaded into the execution context. If the response body is not formatted in JSON or YAML, it is loaded into the payload’s `_value` field.
@@ -161,7 +152,6 @@ Conditions, transforms, and actions access the response data through the executi
161152

162153
In addition all the headers from the response can be accessed using the `ctx.payload._headers` field as well as the HTTP status code of the response using `ctx.payload._status_code`.
163154

164-
165155
## HTTP input attributes [http-input-attributes]
166156

167157
| Name | Required | Default | Description |
@@ -193,5 +183,3 @@ You can reference the following variables in the execution context when specifyi
193183
| `ctx.trigger.triggered_time` | The time this watch was triggered. |
194184
| `ctx.trigger.scheduled_time` | The time this watch was supposed to be triggered. |
195185
| `ctx.metadata.*` | Any metadata associated with the watch. |
196-
197-

explore-analyze/alerts-cases/watcher/input-search.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/elasticsearch/reference/current/input-search.html
55
---
66

7-
8-
97
# Search input [input-search]
108

11-
129
Use the `search` input to load the results of an Elasticsearch search request into the execution context when the watch is triggered. See [Search Input Attributes](#search-input-attributes) for all of the supported attributes.
1310

1411
In the search input’s `request` object, you specify:
@@ -74,7 +71,6 @@ For example, the following input loads only the total number of hits into the wa
7471
},
7572
```
7673

77-
7874
## Using Templates [_using_templates]
7975

8076
The `search` input supports [search templates](../../../solutions/search/search-templates.md). For example, the following snippet references the indexed template called `my_template` and passes a value of 23 to fill in the template’s `value` parameter:
@@ -98,7 +94,6 @@ The `search` input supports [search templates](../../../solutions/search/search-
9894
}
9995
```
10096

101-
10297
## Applying conditions [_applying_conditions]
10398

10499
The `search` input is often used in conjunction with the [`script`](condition-script.md) condition. For example, the following snippet adds a condition to check if the search returned more than five hits:
@@ -122,7 +117,6 @@ The `search` input is often used in conjunction with the [`script`](condition-sc
122117
}
123118
```
124119

125-
126120
## Accessing the search results [_accessing_the_search_results]
127121

128122
Conditions, transforms, and actions can access the search results through the watch execution context. For example:
@@ -132,12 +126,10 @@ Conditions, transforms, and actions can access the search results through the wa
132126
* To access a particular hit, use its zero-based array index. For example, to get the third hit, use `ctx.payload.hits.hits.2`.
133127
* To get a field value from a particular hit, use `ctx.payload.hits.hits.<index>.fields.<fieldname>`. For example, to get the message field from the first hit, use `ctx.payload.hits.hits.0.fields.message`.
134128

135-
::::{note}
129+
::::{note}
136130
The total number of hits in the search response is returned as an object in the response. It contains a `value`, the number of hits, and a `relation` that indicates if the value is accurate (`"eq"`) or a lower bound of the total hits that match the query (`"gte"`). You can set `track_total_hits` to true in the search request to tell Elasticsearch to always track the number of hits accurately.
137131
::::
138132

139-
140-
141133
## Search Input Attributes [search-input-attributes]
142134

143135
| Name | Required | Default | Description |
@@ -161,5 +153,3 @@ You can reference the following variables in the execution context when specifyi
161153
| `ctx.trigger.triggered_time` | The time this watch was triggered. |
162154
| `ctx.trigger.scheduled_time` | The time this watch was supposed to be triggered. |
163155
| `ctx.metadata.*` | Any metadata associated with the watch. |
164-
165-

explore-analyze/alerts-cases/watcher/input-simple.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/elasticsearch/reference/current/input-simple.html
55
---
66

7-
8-
97
# Simple input [input-simple]
108

11-
129
Use the `simple` input to load static data into the execution context when the watch is triggered. This enables you to store the data centrally and reference it with templates.
1310

1411
You can define the static data as a string (`str`), numeric value (`num`), or an object (`obj`):
@@ -50,4 +47,3 @@ For example, the following watch uses the `simple` input to set the recipient na
5047
}
5148
}
5249
```
53-

explore-analyze/alerts-cases/watcher/input.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ mapped_pages:
44
- https://www.elastic.co/guide/en/elasticsearch/reference/current/input.html
55
---
66

7-
8-
97
# Inputs [input]
108

11-
129
When a watch is triggered, its *input* loads data into the execution context. This payload is accessible during the subsequent watch execution phases. For example, you can base a watch’s condition on the data loaded by its input.
1310

1411
{{watcher}} supports four input types:
@@ -18,12 +15,6 @@ When a watch is triggered, its *input* loads data into the execution context. Th
1815
* [`http`](input-http.md): load the results of an HTTP request into the execution context.
1916
* [`chain`](input-chain.md): use a series of inputs to load data into the execution context.
2017

21-
::::{note}
18+
::::{note}
2219
If you don’t define an input for a watch, an empty payload is loaded into the execution context.
2320
::::
24-
25-
26-
27-
28-
29-

explore-analyze/alerts-cases/watcher/watcher-getting-started.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ mapped_pages:
55

66
# Getting started with Watcher [watcher-getting-started]
77

8-
$$$watch-log-data$$$
98
To set up a watch to start sending alerts:
109

1110
* [Schedule the watch and define an input](#log-add-input).
1211
* [Add a condition](#log-add-condition) that checks to see if an alert needs to be sent.
1312
* [Configure an action](#log-take-action) to send an alert when the condition is met.
1413

15-
16-
## Schedule the watch and define an input [log-add-input]
14+
## Schedule the watch and define an input [log-add-input]
1715

1816
A watch [schedule](trigger-schedule.md) controls how often a watch is triggered. The watch [input](input.md) gets the data that you want to evaluate.
1917

@@ -56,8 +54,7 @@ GET .watcher-history*/_search?pretty
5654
}
5755
```
5856

59-
60-
## Add a condition [log-add-condition]
57+
## Add a condition [log-add-condition]
6158

6259
A [condition](condition.md) evaluates the data you’ve loaded into the watch and determines if any action is required. Now that you’ve loaded log errors into the watch, you can define a condition that checks to see if any errors were found.
6360

@@ -87,7 +84,6 @@ PUT _watcher/watch/log_error_watch
8784

8885
1. The [compare](condition-compare.md) condition lets you easily compare against values in the execution context.
8986

90-
9187
For this compare condition to evaluate to `true`, you need to add an event to the `logs` index that contains an error. For example, the following request adds a 404 error to the `logs` index:
9288

9389
```console
@@ -116,8 +112,7 @@ GET .watcher-history*/_search?pretty
116112
}
117113
```
118114

119-
120-
## Configure an action [log-take-action]
115+
## Configure an action [log-take-action]
121116

122117
Recording watch records in the watch history is nice, but the real power of {{watcher}} is being able to do something when the watch condition is met. A watch’s [actions](actions.md) define what to do when the watch condition evaluates to `true`. You can send emails, call third-party webhooks, write documents to an Elasticsearch index, or log messages to the standard Elasticsearch log files.
123118

@@ -152,8 +147,7 @@ PUT _watcher/watch/log_error_watch
152147
}
153148
```
154149

155-
156-
## Delete the Watch [log-delete]
150+
## Delete the Watch [log-delete]
157151

158152
Since the `log_error_watch` is configured to run every 10 seconds, make sure you delete it when you’re done experimenting. Otherwise, the noise from this sample watch will make it hard to see what else is going on in your watch history and log file.
159153

@@ -163,17 +157,14 @@ To remove the watch, use the [delete watch API](https://www.elastic.co/guide/en/
163157
DELETE _watcher/watch/log_error_watch
164158
```
165159

166-
167-
## Required security privileges [required-security-privileges]
160+
## Required security privileges [required-security-privileges]
168161

169162
To enable users to create and manipulate watches, assign them the `watcher_admin` security role. Watcher admins can also view watches, watch history, and triggered watches.
170163

171164
To allow users to view watches and the watch history, assign them the `watcher_user` security role. Watcher users cannot create or manipulate watches; they are only allowed to execute read-only watch operations.
172165

173-
174-
## Where to go next [next-steps]
166+
## Where to go next [next-steps]
175167

176168
* See [*How {{watcher}} works*](how-watcher-works.md) for more information about the anatomy of a watch and the watch lifecycle.
177169
* See [*Example watches*](example-watches.md) for more examples of setting up a watch.
178170
* See the [Example Watches](https://github.com/elastic/examples/tree/master/Alerting) in the Elastic Examples repo for additional sample watches you can use as a starting point for building custom watches.
179-

explore-analyze/alerts-cases/watcher/watcher-ui.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# Watcher UI [watcher-ui]
22

3-
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.
4-
53
Go to the **Watcher** page using the navigation menu or the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md). With this UI, you can:
64

7-
* [Create a simple threshold watch](../../../explore-analyze/alerts-cases/watcher.md#watcher-create-threshold-alert)
8-
* [View your watch history and action status](../../../explore-analyze/alerts-cases/watcher.md#watcher-getting-started)
9-
* [Deactivate and delete a watch](../../../explore-analyze/alerts-cases/watcher.md#watcher-deactivate)
10-
* [Create an advanced watch using API syntax](../../../explore-analyze/alerts-cases/watcher.md#watcher-create-advanced-watch)
5+
* [Create a simple threshold watch](#watcher-create-threshold-alert)
6+
* [View your watch history and action status](#watcher-getting-started)
7+
* [Deactivate and delete a watch](#watcher-deactivate)
8+
* [Create an advanced watch using API syntax](#watcher-create-advanced-watch)
119

1210
![Watcher list](../../../images/kibana-watches.png "")
1311

1412
[Alerting on cluster and index events](../../../explore-analyze/alerts-cases/watcher.md) is a good source for detailed information on how watches work. If you are using the UI to create a threshold watch, take a look at the different watcher actions. If you are creating an advanced watch, you should be familiar with the parts of a watch—input, schedule, condition, and actions.
1513

1614
::::{note}
17-
There are limitations in **Watcher** that affect {{kib}}. For information, refer to [Alerting](../../../explore-analyze/alerts-cases/watcher/watcher-limitations.md).
15+
There are limitations in **Watcher** that affect {{kib}}. For information, refer to [Limitations](watcher-limitations.md).
1816
::::
1917

2018
## Watcher security [watcher-security]
@@ -146,5 +144,5 @@ After starting the simulation, you’ll see a results screen. For more informati
146144

147145
Refer to these examples for creating an advanced watch:
148146

149-
* [Watch the status of an {{es}} cluster](../../../explore-analyze/alerts-cases/watcher/watch-cluster-status.md)
150-
* [Watch event data](https://www.elastic.co/guide/en/elasticsearch/reference/current/example-watches.html)
147+
* [Watch the status of an {{es}} cluster](watch-cluster-status.md)
148+
* [Watch event data](example-watches.md)

0 commit comments

Comments
 (0)