All Products
Search
Document Center

Elasticsearch:Cluster alerting based on X-Pack Watcher

Last Updated:Nov 06, 2023

X-Pack Watcher is an Elasticsearch-based monitoring and alerting service. X-Pack Watcher can track network activities, monitor metrics for infrastructure, index data, and cluster health status, and report alerts. If you configure X-Pack Watcher for your Elasticsearch cluster, X-Pack Watcher can trigger actions when specific conditions are met.

Overview

X-Pack Watcher allows you to create watches. A watch consists of a trigger, an input, a condition, and actions.

  • Trigger

    Determines when a watch starts to run, that is, the interval at which the operation specified in the related input is performed. X-Pack Watcher supports multiple types of triggers. For more information, see Schedule Trigger.

  • Input

    Loads data into the execution context of a watch when the watch is triggered. This execution context is accessible during the subsequent execution phases of the watch. If no input is specified for a watch, an empty execution context is loaded. For more information, see Inputs.

    A watch supports the following types of inputs:

    • simple: loads static data into the execution context. For example, you can enter a piece of data for alerting.

    • search: loads the results of a search into the execution context. For example, the results of a full-text search that is performed based on a keyword are used for alerting.

    • http: loads the results of an HTTP request into the execution context. For example, the results of calling an Elasticsearch API operation that is used to query the health status and node status of an Elasticsearch cluster are used for alerting.

    • chain: loads a series of input data into the execution context. In most cases, the input data has different sources.

  • Condition

    Controls whether a watch performs actions. If specific conditions are met, the watch performs actions. If no condition is specified for a watch, the always condition is used by default. For more information, see Conditions.

    A watch supports the following types of conditions:

    • always: Conditions are always met, and the watch always performs actions.

    • never: Conditions are never met, and the watch never performs actions.

    • compare: The values in the payload of the watch are compared to determine whether to perform actions.

    • array_compare: An array of values in the payload of the watch is compared with a specific value to determine whether to perform actions.

    • script: A script is used to determine whether to perform actions.

  • Actions

    Determines the actions that a watch performs when specific conditions are met. A watch supports actions such as email, webhook, index, and logging. For more information, see Actions.

    Note

    Alibaba Cloud Elasticsearch does not support the email action because an endpoint limit is imposed on this type of action. We recommend that you use the webhook action.

Use scenarios

Precautions