Watcher settings in Elasticsearchedit

You configure Watcher settings to set up Watcher and send notifications via email, Slack, and PagerDuty.

All of these settings can be added to the elasticsearch.yml configuration file, with the exception of the secure settings, which you add to the Elasticsearch keystore. For more information about creating and updating the Elasticsearch keystore, see Secure settings. Dynamic settings can also be updated across a cluster with the cluster update settings API.

General Watcher Settingsedit

xpack.watcher.enabled
Set to false to disable Watcher on the node.
xpack.watcher.encrypt_sensitive_data
Set to true to encrypt sensitive data. If this setting is enabled, you must also specify the xpack.watcher.encryption_key setting. For more information, see Encrypting sensitive data in Watcher.
xpack.watcher.encryption_key (Secure)
Specifies the path to a file that contains a key for encrypting sensitive data. If xpack.watcher.encrypt_sensitive_data is set to true, this setting is required. For more information, see Encrypting sensitive data in Watcher.
xpack.watcher.history.cleaner_service.enabled

[6.3.0] Added in 6.3.0. Default changed to true. [7.0.0] Deprecated in 7.0.0. Watcher history indices are now managed by the watch-history-ilm-policy ILM policy

Set to true (default) to enable the cleaner service. If this setting is true, the xpack.monitoring.enabled setting must also be set to true with a local exporter enabled. The cleaner service removes previous versions of Watcher indices (for example, .watcher-history*) when it determines that they are old. The duration of Watcher indices is determined by the xpack.monitoring.history.duration setting, which defaults to 7 days. For more information about that setting, see Monitoring settings.

xpack.http.proxy.host
Specifies the address of the proxy server to use to connect to HTTP services.
xpack.http.proxy.port
Specifies the port number to use to connect to the proxy server.
xpack.http.default_connection_timeout
The maximum period to wait until abortion of the request, when a connection is being initiated.
xpack.http.default_read_timeout
The maximum period of inactivity between two data packets, before the request is aborted.
xpack.http.max_response_size
Specifies the maximum size an HTTP response is allowed to have, defaults to 10mb, the maximum configurable value is 50mb.
xpack.http.whitelist
A list of URLs, that the internal HTTP client is allowed to connect to. This client is used in the HTTP input, the webhook, the slack, pagerduty, and jira actions. This setting can be updated dynamically. It defaults to * allowing everything. Note: If you configure this setting and you are using one of the slack/pagerduty actions, you have to ensure that the corresponding endpoints are explicitly allowed as well.

Watcher HTTP TLS/SSL settingsedit

You can configure the following TLS/SSL settings.

xpack.http.ssl.supported_protocols

Supported protocols with versions. Valid protocols: SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3. If the JVM’s SSL provider supports TLSv1.3, the default is TLSv1.3,TLSv1.2,TLSv1.1. Otherwise, the default is TLSv1.2,TLSv1.1.

If xpack.security.fips_mode.enabled is true, you cannot use SSLv2Hello or SSLv3. See FIPS 140-2.

xpack.http.ssl.verification_mode

Controls the verification of certificates. Valid values are:

  • full, which verifies that the provided certificate is signed by a trusted authority (CA) and also verifies that the server’s hostname (or IP address) matches the names identified within the certificate.
  • certificate, which verifies that the provided certificate is signed by a trusted authority (CA), but does not perform any hostname verification.
  • none, which performs no verification of the server’s certificate. This mode disables many of the security benefits of SSL/TLS and should only be used after very careful consideration. It is primarily intended as a temporary diagnostic mechanism when attempting to resolve TLS errors; its use on production clusters is strongly discouraged.

    The default value is full.

xpack.http.ssl.cipher_suites

Supported cipher suites vary depending on which version of Java you use. For example, for version 11 the default value is TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA.

The default cipher suites list above includes TLSv1.3 ciphers and ciphers that require the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for 256-bit AES encryption. If TLSv1.3 is not available, the TLSv1.3 ciphers TLS_AES_256_GCM_SHA384 and TLS_AES_128_GCM_SHA256 are not included in the default list. If 256-bit AES is unavailable, ciphers with AES_256 in their names are not included in the default list. Finally, AES GCM has known performance issues in Java versions prior to 11 and is included in the default list only when using Java 11 or above.

For more information, see Oracle’s Java Cryptography Architecture documentation.

Watcher HTTP TLS/SSL key and trusted certificate settingsedit

The following settings are used to specify a private key, certificate, and the trusted certificates that should be used when communicating over an SSL/TLS connection. A private key and certificate are optional and would be used if the server requires client authentication for PKI authentication.

PEM encoded filesedit

When using PEM encoded files, use the following settings:

xpack.http.ssl.key
Path to a PEM encoded file containing the private key.
xpack.http.ssl.key_passphrase
The passphrase that is used to decrypt the private key. Since the key might not be encrypted, this value is optional.
xpack.http.ssl.secure_key_passphrase (Secure)
The passphrase that is used to decrypt the private key. Since the key might not be encrypted, this value is optional.
xpack.http.ssl.certificate
Specifies the path for the PEM encoded certificate (or certificate chain) that is associated with the key.
xpack.http.ssl.certificate_authorities
List of paths to PEM encoded certificate files that should be trusted.

Java keystore filesedit

When using Java keystore files (JKS), which contain the private key, certificate and certificates that should be trusted, use the following settings:

xpack.http.ssl.keystore.path
The path for the keystore file that contains a private key and certificate.
xpack.http.ssl.keystore.password
The password for the keystore.
xpack.http.ssl.keystore.secure_password (Secure)
The password for the keystore.
xpack.http.ssl.keystore.key_password
The password for the key in the keystore. The default is the keystore password.
xpack.http.ssl.keystore.secure_key_password (Secure)
The password for the key in the keystore. The default is the keystore password.
xpack.http.ssl.truststore.path
The path for the keystore that contains the certificates to trust. It must be either a Java keystore (jks) or a PKCS#12 file.
xpack.http.ssl.truststore.password
The password for the truststore.
xpack.http.ssl.truststore.secure_password (Secure)
Password for the truststore.

PKCS#12 filesedit

Elasticsearch can be configured to use PKCS#12 container files (.p12 or .pfx files) that contain the private key, certificate and certificates that should be trusted.

PKCS#12 files are configured in the same way as Java keystore files:

xpack.http.ssl.keystore.path
The path for the keystore file that contains a private key and certificate.
xpack.http.ssl.keystore.type
The format of the keystore file. It must be either jks or PKCS12. If the keystore path ends in ".p12", ".pfx", or ".pkcs12", this setting defaults to PKCS12. Otherwise, it defaults to jks.
xpack.http.ssl.keystore.password
The password for the keystore.
xpack.http.ssl.keystore.secure_password (Secure)
The password for the keystore.
xpack.http.ssl.keystore.key_password
The password for the key in the keystore. The default is the keystore password.
xpack.http.ssl.keystore.secure_key_password (Secure)
The password for the key in the keystore. The default is the keystore password.
xpack.http.ssl.truststore.path
The path for the keystore that contains the certificates to trust. It must be either a Java keystore (jks) or a PKCS#12 file.
xpack.http.ssl.truststore.type
Set this to PKCS12 to indicate that the truststore is a PKCS#12 file.
xpack.http.ssl.truststore.password
The password for the truststore.
xpack.http.ssl.truststore.secure_password (Secure)
Password for the truststore.

PKCS#11 tokensedit

Elasticsearch can be configured to use a PKCS#11 token that contains the private key, certificate and certificates that should be trusted.

PKCS#11 token require additional configuration on the JVM level and can be enabled via the following settings:

xpack.http.keystore.type
Set this to PKCS11 to indicate that the PKCS#11 token should be used as a keystore.
xpack.http.truststore.type
The format of the truststore file. For the Java keystore format, use jks. For PKCS#12 files, use PKCS12. For a PKCS#11 token, use PKCS11. The default is jks.

When configuring the PKCS#11 token that your JVM is configured to use as a keystore or a truststore for Elasticsearch, the PIN for the token can be configured by setting the appropriate value to ssl.truststore.password or ssl.truststore.secure_password in the context that you are configuring. Since there can only be one PKCS#11 token configured, only one keystore and truststore will be usable for configuration in Elasticsearch. This in turn means that only one certificate can be used for TLS both in the transport and the http layer.

Email Notification Settingsedit

You can configure the following email notification settings in elasticsearch.yml. For more information about sending notifications via email, see Configuring email actions.

xpack.notification.email.account

Specifies account information for sending notifications via email. You can specify the following email account attributes:

profile (Dynamic)
The email profile to use to build the MIME messages that are sent from the account. Valid values: standard, gmail and outlook. Defaults to standard.
email_defaults.* (Dynamic)
An optional set of email attributes to use as defaults for the emails sent from the account. See Email action attributes for the supported attributes.
smtp.auth (Dynamic)
Set to true to attempt to authenticate the user using the AUTH command. Defaults to false.
smtp.host (Dynamic)
The SMTP server to connect to. Required.
smtp.port (Dynamic)
The SMTP server port to connect to. Defaults to 25.
smtp.user (Dynamic)
The user name for SMTP. Required.
smtp.secure_password (Secure)
The password for the specified SMTP user.
smtp.starttls.enable (Dynamic)
Set to true to enable the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the server’s certificate. Defaults to false.
smtp.starttls.required (Dynamic)
If true, then STARTTLS will be required. If that command fails, the connection will fail. Defaults to false.
smtp.ssl.trust (Dynamic)
A list of SMTP server hosts that are assumed trusted and for which certificate verification is disabled. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents.
smtp.timeout (Dynamic)
The socket read timeout. Default is two minutes.
smtp.connection_timeout (Dynamic)
The socket connection timeout. Default is two minutes.
smtp.write_timeout (Dynamic)
The socket write timeout. Default is two minutes.
smtp.local_address (Dynamic)
A configurable local address when sending emails. Not configured by default.
smtp.local_port (Dynamic)
A configurable local port when sending emails. Not configured by default.
smtp.send_partial (Dynamic)
Send an email, despite one of the receiver addresses being invalid.
smtp.wait_on_quit (Dynamic)
If set to false the QUIT command is sent and the connection closed. If set to true, the QUIT command is sent and a reply is waited for. True by default.
xpack.notification.email.html.sanitization.allow

Specifies the HTML elements that are allowed in email notifications. For more information, see Configuring HTML sanitization options. You can specify individual HTML elements and the following HTML feature groups:

_tables
All table related elements: <table>, <th>, <tr> and <td>.
_blocks
The following block elements: <p>, <div>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <li>, and <blockquote>.
_formatting
The following inline formatting elements: <b>, <i>, <s>, <u>, <o>, <sup>, <sub>, <ins>, <del>, <strong>, <strike>, <tt>, <code>, <big>, <small>, <br>, <span>, and <em>.
_links
The <a> element with an href attribute that points to a URL using the following protocols: http, https and mailto.
_styles
The style attribute on all elements. Note that CSS attributes are also sanitized to prevent XSS attacks.
img
img:all
All images (external and embedded).
img:embedded
Only embedded images. Embedded images can only use the cid: URL protocol in their src attribute.
xpack.notification.email.html.sanitization.disallow
Specifies the HTML elements that are NOT allowed in email notifications. You can specify individual HTML elements and HTML feature groups.
xpack.notification.email.html.sanitization.enabled
Set to false to completely disable HTML sanitation. Not recommended. Defaults to true.

Watcher Email TLS/SSL settingsedit

You can configure the following TLS/SSL settings.

xpack.notification.email.ssl.supported_protocols

Supported protocols with versions. Valid protocols: SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3. If the JVM’s SSL provider supports TLSv1.3, the default is TLSv1.3,TLSv1.2,TLSv1.1. Otherwise, the default is TLSv1.2,TLSv1.1.

If xpack.security.fips_mode.enabled is true, you cannot use SSLv2Hello or SSLv3. See FIPS 140-2.

xpack.notification.email.ssl.verification_mode

Controls the verification of certificates. Valid values are:

  • full, which verifies that the provided certificate is signed by a trusted authority (CA) and also verifies that the server’s hostname (or IP address) matches the names identified within the certificate.
  • certificate, which verifies that the provided certificate is signed by a trusted authority (CA), but does not perform any hostname verification.
  • none, which performs no verification of the server’s certificate. This mode disables many of the security benefits of SSL/TLS and should only be used after very careful consideration. It is primarily intended as a temporary diagnostic mechanism when attempting to resolve TLS errors; its use on production clusters is strongly discouraged.

    The default value is full.

xpack.notification.email.ssl.cipher_suites

Supported cipher suites vary depending on which version of Java you use. For example, for version 11 the default value is TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA.

The default cipher suites list above includes TLSv1.3 ciphers and ciphers that require the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for 256-bit AES encryption. If TLSv1.3 is not available, the TLSv1.3 ciphers TLS_AES_256_GCM_SHA384 and TLS_AES_128_GCM_SHA256 are not included in the default list. If 256-bit AES is unavailable, ciphers with AES_256 in their names are not included in the default list. Finally, AES GCM has known performance issues in Java versions prior to 11 and is included in the default list only when using Java 11 or above.

For more information, see Oracle’s Java Cryptography Architecture documentation.

Watcher Email TLS/SSL key and trusted certificate settingsedit

The following settings are used to specify a private key, certificate, and the trusted certificates that should be used when communicating over an SSL/TLS connection. A private key and certificate are optional and would be used if the server requires client authentication for PKI authentication.

PEM encoded filesedit

When using PEM encoded files, use the following settings:

xpack.notification.email.ssl.key
Path to a PEM encoded file containing the private key.
xpack.notification.email.ssl.key_passphrase
The passphrase that is used to decrypt the private key. Since the key might not be encrypted, this value is optional.
xpack.notification.email.ssl.secure_key_passphrase (Secure)
The passphrase that is used to decrypt the private key. Since the key might not be encrypted, this value is optional.
xpack.notification.email.ssl.certificate
Specifies the path for the PEM encoded certificate (or certificate chain) that is associated with the key.
xpack.notification.email.ssl.certificate_authorities
List of paths to PEM encoded certificate files that should be trusted.

Java keystore filesedit

When using Java keystore files (JKS), which contain the private key, certificate and certificates that should be trusted, use the following settings:

xpack.notification.email.ssl.keystore.path
The path for the keystore file that contains a private key and certificate.
xpack.notification.email.ssl.keystore.password
The password for the keystore.
xpack.notification.email.ssl.keystore.secure_password (Secure)
The password for the keystore.
xpack.notification.email.ssl.keystore.key_password
The password for the key in the keystore. The default is the keystore password.
xpack.notification.email.ssl.keystore.secure_key_password (Secure)
The password for the key in the keystore. The default is the keystore password.
xpack.notification.email.ssl.truststore.path
The path for the keystore that contains the certificates to trust. It must be either a Java keystore (jks) or a PKCS#12 file.
xpack.notification.email.ssl.truststore.password
The password for the truststore.
xpack.notification.email.ssl.truststore.secure_password (Secure)
Password for the truststore.

PKCS#12 filesedit

Elasticsearch can be configured to use PKCS#12 container files (.p12 or .pfx files) that contain the private key, certificate and certificates that should be trusted.

PKCS#12 files are configured in the same way as Java keystore files:

xpack.notification.email.ssl.keystore.path
The path for the keystore file that contains a private key and certificate.
xpack.notification.email.ssl.keystore.type
The format of the keystore file. It must be either jks or PKCS12. If the keystore path ends in ".p12", ".pfx", or ".pkcs12", this setting defaults to PKCS12. Otherwise, it defaults to jks.
xpack.notification.email.ssl.keystore.password
The password for the keystore.
xpack.notification.email.ssl.keystore.secure_password (Secure)
The password for the keystore.
xpack.notification.email.ssl.keystore.key_password
The password for the key in the keystore. The default is the keystore password.
xpack.notification.email.ssl.keystore.secure_key_password (Secure)
The password for the key in the keystore. The default is the keystore password.
xpack.notification.email.ssl.truststore.path
The path for the keystore that contains the certificates to trust. It must be either a Java keystore (jks) or a PKCS#12 file.
xpack.notification.email.ssl.truststore.type
Set this to PKCS12 to indicate that the truststore is a PKCS#12 file.
xpack.notification.email.ssl.truststore.password
The password for the truststore.
xpack.notification.email.ssl.truststore.secure_password (Secure)
Password for the truststore.

PKCS#11 tokensedit

Elasticsearch can be configured to use a PKCS#11 token that contains the private key, certificate and certificates that should be trusted.

PKCS#11 token require additional configuration on the JVM level and can be enabled via the following settings:

xpack.notification.email.keystore.type
Set this to PKCS11 to indicate that the PKCS#11 token should be used as a keystore.
xpack.notification.email.truststore.type
The format of the truststore file. For the Java keystore format, use jks. For PKCS#12 files, use PKCS12. For a PKCS#11 token, use PKCS11. The default is jks.

When configuring the PKCS#11 token that your JVM is configured to use as a keystore or a truststore for Elasticsearch, the PIN for the token can be configured by setting the appropriate value to ssl.truststore.password or ssl.truststore.secure_password in the context that you are configuring. Since there can only be one PKCS#11 token configured, only one keystore and truststore will be usable for configuration in Elasticsearch. This in turn means that only one certificate can be used for TLS both in the transport and the http layer.

Slack Notification Settingsedit

You can configure the following Slack notification settings in elasticsearch.yml. For more information about sending notifications via Slack, see Configuring Slack actions.

xpack.notification.slack

Specifies account information for sending notifications via Slack. You can specify the following Slack account attributes:

secure_url (Secure)
The Incoming Webhook URL to use to post messages to Slack. Required.
message_defaults.from
The sender name to display in the Slack message. Defaults to the watch ID.
message_defaults.to
The default Slack channels or groups you want to send messages to.
message_defaults.icon
The icon to display in the Slack messages. Overrides the incoming webhook’s configured icon. Accepts a public URL to an image.
message_defaults.text
The default message content.
message_defaults.attachment
Default message attachments. Slack message attachments enable you to create more richly-formatted messages. Specified as an array as defined in the Slack attachments documentation.

Jira Notification Settingsedit

You can configure the following Jira notification settings in elasticsearch.yml. For more information about using notifications to create issues in Jira, see Configuring Jira actions.

xpack.notification.jira

Specifies account information for using notifications to create issues in Jira. You can specify the following Jira account attributes:

secure_url (Secure)
The URL of the Jira Software server. Required.
secure_user (Secure)
The name of the user to connect to the Jira Software server. Required.
secure_password (Secure)
The password of the user to connect to the Jira Software server. Required.
issue_defaults
Default fields values for the issue created in Jira. See Jira action attributes for more information. Optional.

PagerDuty Notification Settingsedit

You can configure the following PagerDuty notification settings in elasticsearch.yml. For more information about sending notifications via PagerDuty, see Configuring PagerDuty actions.

xpack.notification.pagerduty

Specifies account information for sending notifications via PagerDuty. You can specify the following PagerDuty account attributes:

name
A name for the PagerDuty account associated with the API key you are using to access PagerDuty. Required.
secure_service_api_key (Secure)
The PagerDuty API key to use to access PagerDuty. Required.
event_defaults

Default values for PagerDuty event attributes. Optional.

description
A string that contains the default description for PagerDuty events. If no default is configured, each PagerDuty action must specify a description.
incident_key
A string that contains the default incident key to use when sending PagerDuty events.
client
A string that specifies the default monitoring client.
client_url
The URL of the default monitoring client.
event_type
The default event type. Valid values: trigger,resolve, acknowledge.
attach_payload
Whether or not to provide the watch payload as context for the event by default. Valid values: true, false.