notification-settings.asciidoc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. [role="xpack"]
  2. [[notification-settings]]
  3. === {watcher} settings in Elasticsearch
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>{watcher} settings</titleabbrev>
  7. ++++
  8. You configure {watcher} settings to set up {watcher} and send notifications via
  9. <<email-notification-settings,email>>,
  10. <<slack-notification-settings,Slack>>, and
  11. <<pagerduty-notification-settings, PagerDuty>>.
  12. All of these settings can be added to the `elasticsearch.yml` configuration file,
  13. with the exception of the secure settings, which you add to the {es} keystore.
  14. For more information about creating and updating the {es} keystore, see
  15. <<secure-settings>>. Dynamic settings can also be updated across a cluster with the
  16. <<cluster-update-settings,cluster update settings API>>.
  17. [float]
  18. [[general-notification-settings]]
  19. ==== General Watcher Settings
  20. `xpack.watcher.enabled`::
  21. Set to `false` to disable {watcher} on the node.
  22. `xpack.watcher.encrypt_sensitive_data`::
  23. Set to `true` to encrypt sensitive data. If this setting is enabled, you
  24. must also specify the `xpack.watcher.encryption_key` setting. For more
  25. information, see <<encrypting-data>>.
  26. `xpack.watcher.encryption_key` (<<secure-settings,Secure>>)::
  27. Specifies the path to a file that contains a key for encrypting sensitive data.
  28. If `xpack.watcher.encrypt_sensitive_data` is set to `true`, this setting is
  29. required. For more information, see <<encrypting-data>>.
  30. `xpack.watcher.history.cleaner_service.enabled`::
  31. added:[6.3.0,Default changed to `true`.]
  32. deprecated:[7.0.0,Watcher history indices are now managed by the `watch-history-ilm-policy` ILM policy]
  33. +
  34. Set to `true` (default) to enable the cleaner service. The cleaner service
  35. removes previous versions of {watcher} indices (for example,
  36. `.watcher-history*`) when it determines that they are old. The duration of
  37. {watcher} indices is determined by the `xpack.monitoring.history.duration`
  38. setting, which defaults to 7 days. For more information about that setting,
  39. see <<monitoring-settings>>.
  40. `xpack.http.proxy.host`::
  41. Specifies the address of the proxy server to use to connect to HTTP services.
  42. `xpack.http.proxy.port`::
  43. Specifies the port number to use to connect to the proxy server.
  44. `xpack.http.default_connection_timeout`::
  45. The maximum period to wait until abortion of the request, when a
  46. connection is being initiated.
  47. `xpack.http.default_read_timeout`::
  48. The maximum period of inactivity between two data packets, before the
  49. request is aborted.
  50. `xpack.http.max_response_size`::
  51. Specifies the maximum size an HTTP response is allowed to have, defaults to
  52. `10mb`, the maximum configurable value is `50mb`.
  53. `xpack.http.whitelist`::
  54. A list of URLs, that the internal HTTP client is allowed to connect to. This
  55. client is used in the HTTP input, the webhook, the slack, pagerduty,
  56. and jira actions. This setting can be updated dynamically. It defaults to `*`
  57. allowing everything. Note: If you configure this setting and you are using one
  58. of the slack/pagerduty actions, you have to ensure that the
  59. corresponding endpoints are explicitly allowed as well.
  60. [[ssl-notification-settings]]
  61. :ssl-prefix: xpack.http
  62. :component: {watcher} HTTP
  63. :verifies:
  64. :server!:
  65. :ssl-context: watcher
  66. include::ssl-settings.asciidoc[]
  67. [float]
  68. [[email-notification-settings]]
  69. ==== Email Notification Settings
  70. You can configure the following email notification settings in
  71. `elasticsearch.yml`. For more information about sending notifications
  72. via email, see <<configuring-email-actions>>.
  73. `xpack.notification.email.account`::
  74. Specifies account information for sending notifications via email. You
  75. can specify the following email account attributes:
  76. +
  77. --
  78. [[email-account-attributes]]
  79. `profile` (<<cluster-update-settings,Dynamic>>);;
  80. The <<configuring-email,email profile>> to use to build the MIME
  81. messages that are sent from the account. Valid values: `standard`, `gmail` and
  82. `outlook`. Defaults to `standard`.
  83. `email_defaults.*` (<<cluster-update-settings,Dynamic>>);;
  84. An optional set of email attributes to use as defaults
  85. for the emails sent from the account. See
  86. <<email-action-attributes>> for the supported
  87. attributes.
  88. `smtp.auth` (<<cluster-update-settings,Dynamic>>);;
  89. Set to `true` to attempt to authenticate the user using the
  90. AUTH command. Defaults to `false`.
  91. `smtp.host` (<<cluster-update-settings,Dynamic>>);;
  92. The SMTP server to connect to. Required.
  93. `smtp.port` (<<cluster-update-settings,Dynamic>>);;
  94. The SMTP server port to connect to. Defaults to 25.
  95. `smtp.user` (<<cluster-update-settings,Dynamic>>);;
  96. The user name for SMTP. Required.
  97. `smtp.secure_password` (<<secure-settings,Secure>>);;
  98. The password for the specified SMTP user.
  99. `smtp.starttls.enable` (<<cluster-update-settings,Dynamic>>);;
  100. Set to `true` to enable the use of the `STARTTLS`
  101. command (if supported by the server) to switch the connection to a
  102. TLS-protected connection before issuing any login commands. Note that
  103. an appropriate trust store must configured so that the client will
  104. trust the server's certificate. Defaults to `false`.
  105. `smtp.starttls.required` (<<cluster-update-settings,Dynamic>>);;
  106. If `true`, then `STARTTLS` will be required. If that command fails, the
  107. connection will fail. Defaults to `false`.
  108. `smtp.ssl.trust` (<<cluster-update-settings,Dynamic>>);;
  109. A list of SMTP server hosts that are assumed trusted and for which
  110. certificate verification is disabled. If set to "*", all hosts are
  111. trusted. If set to a whitespace separated list of hosts, those hosts
  112. are trusted. Otherwise, trust depends on the certificate the server
  113. presents.
  114. `smtp.timeout` (<<cluster-update-settings,Dynamic>>);;
  115. The socket read timeout. Default is two minutes.
  116. `smtp.connection_timeout` (<<cluster-update-settings,Dynamic>>);;
  117. The socket connection timeout. Default is two minutes.
  118. `smtp.write_timeout` (<<cluster-update-settings,Dynamic>>);;
  119. The socket write timeout. Default is two minutes.
  120. `smtp.local_address` (<<cluster-update-settings,Dynamic>>);;
  121. A configurable local address when sending emails. Not configured by default.
  122. `smtp.local_port` (<<cluster-update-settings,Dynamic>>);;
  123. A configurable local port when sending emails. Not configured by default.
  124. `smtp.send_partial` (<<cluster-update-settings,Dynamic>>);;
  125. Send an email, despite one of the receiver addresses being invalid.
  126. `smtp.wait_on_quit` (<<cluster-update-settings,Dynamic>>);;
  127. If set to false the QUIT command is sent and the connection closed. If set to
  128. true, the QUIT command is sent and a reply is waited for. True by default.
  129. --
  130. `xpack.notification.email.html.sanitization.allow`::
  131. Specifies the HTML elements that are allowed in email notifications. For
  132. more information, see
  133. <<email-html-sanitization>>. You can
  134. specify individual HTML elements and the following HTML feature groups:
  135. +
  136. --
  137. [[html-feature-groups]]
  138. `_tables`;;
  139. All table related elements: `<table>`, `<th>`, `<tr>`
  140. and `<td>`.
  141. `_blocks`;;
  142. The following block elements: `<p>`, `<div>`, `<h1>`,
  143. `<h2>`, `<h3>`, `<h4>`, `<h5>`, `<h6>`, `<ul>`, `<ol>`,
  144. `<li>`, and `<blockquote>`.
  145. `_formatting`;;
  146. The following inline formatting elements: `<b>`, `<i>`,
  147. `<s>`, `<u>`, `<o>`, `<sup>`, `<sub>`, `<ins>`, `<del>`,
  148. `<strong>`, `<strike>`, `<tt>`, `<code>`, `<big>`,
  149. `<small>`, `<br>`, `<span>`, and `<em>`.
  150. `_links`;;
  151. The `<a>` element with an `href` attribute that points
  152. to a URL using the following protocols: `http`, `https`
  153. and `mailto`.
  154. `_styles`;;
  155. The `style` attribute on all elements. Note that CSS
  156. attributes are also sanitized to prevent XSS attacks.
  157. `img`;;
  158. `img:all`;;
  159. All images (external and embedded).
  160. `img:embedded`;;
  161. Only embedded images. Embedded images can only use the
  162. `cid:` URL protocol in their `src` attribute.
  163. --
  164. `xpack.notification.email.html.sanitization.disallow`::
  165. Specifies the HTML elements that are NOT allowed in email notifications.
  166. You can specify individual HTML elements and <<html-feature-groups,
  167. HTML feature groups>>.
  168. `xpack.notification.email.html.sanitization.enabled` ::
  169. Set to `false` to completely disable HTML sanitation. Not recommended.
  170. Defaults to `true`.
  171. [[ssl-notification-smtp-settings]]
  172. :ssl-prefix: xpack.notification.email
  173. :component: {watcher} Email
  174. :verifies:
  175. :server!:
  176. :ssl-context: watcher-email
  177. include::ssl-settings.asciidoc[]
  178. [float]
  179. [[slack-notification-settings]]
  180. ==== Slack Notification Settings
  181. You can configure the following Slack notification settings in
  182. `elasticsearch.yml`. For more information about sending notifications
  183. via Slack, see <<configuring-slack-actions>>.
  184. `xpack.notification.slack` ::
  185. Specifies account information for sending notifications
  186. via Slack. You can specify the following Slack account attributes:
  187. +
  188. --
  189. [[slack-account-attributes]]
  190. `secure_url` (<<secure-settings,Secure>>);;
  191. The Incoming Webhook URL to use to post messages to Slack. Required.
  192. `message_defaults.from`;;
  193. The sender name to display in the
  194. Slack message. Defaults to the watch ID.
  195. `message_defaults.to`;;
  196. The default Slack channels or groups you
  197. want to send messages to.
  198. `message_defaults.icon`;;
  199. The icon to display in the Slack messages.
  200. Overrides the incoming webhook's configured
  201. icon. Accepts a public URL to an image.
  202. `message_defaults.text`;;
  203. The default message content.
  204. `message_defaults.attachment`;;
  205. Default message attachments. Slack message attachments
  206. enable you to create more richly-formatted messages.
  207. Specified as an array as defined in the
  208. https://api.slack.com/docs/attachments[
  209. Slack attachments documentation].
  210. --
  211. [float]
  212. [[jira-notification-settings]]
  213. ==== Jira Notification Settings
  214. You can configure the following Jira notification settings in
  215. `elasticsearch.yml`. For more information about using notifications
  216. to create issues in Jira, see <<configuring-jira-actions>>.
  217. `xpack.notification.jira` ::
  218. Specifies account information for using notifications to create
  219. issues in Jira. You can specify the following Jira account attributes:
  220. +
  221. --
  222. [[jira-account-attributes]]
  223. `secure_url` (<<secure-settings,Secure>>);;
  224. The URL of the Jira Software server. Required.
  225. `secure_user` (<<secure-settings,Secure>>);;
  226. The name of the user to connect to the Jira Software server. Required.
  227. `secure_password` (<<secure-settings,Secure>>);;
  228. The password of the user to connect to the Jira Software server. Required.
  229. `issue_defaults`;;
  230. Default fields values for the issue created in Jira. See
  231. <<jira-action-attributes>> for more information.
  232. Optional.
  233. --
  234. [float]
  235. [[pagerduty-notification-settings]]
  236. ==== PagerDuty Notification Settings
  237. You can configure the following PagerDuty notification settings in
  238. `elasticsearch.yml`. For more information about sending notifications
  239. via PagerDuty, see <<configuring-pagerduty-actions>>.
  240. [[pagerduty-account-attributes]]
  241. `xpack.notification.pagerduty`::
  242. Specifies account information for sending notifications
  243. via PagerDuty. You can specify the following PagerDuty account attributes:
  244. +
  245. --
  246. `name`;;
  247. A name for the PagerDuty account associated with the API key you
  248. are using to access PagerDuty. Required.
  249. `secure_service_api_key` (<<secure-settings,Secure>>);;
  250. The https://developer.pagerduty.com/documentation/rest/authentication[
  251. PagerDuty API key] to use to access PagerDuty. Required.
  252. --
  253. +
  254. `event_defaults`;;
  255. Default values for
  256. <<pagerduty-event-trigger-incident-attributes,PagerDuty event attributes>>.
  257. Optional.
  258. +
  259. --
  260. `description`::
  261. A string that contains the default description for PagerDuty events.
  262. If no default is configured, each PagerDuty action must specify a
  263. `description`.
  264. `incident_key`::
  265. A string that contains the default incident key to use when sending
  266. PagerDuty events.
  267. `client`::
  268. A string that specifies the default monitoring client.
  269. `client_url`::
  270. The URL of the default monitoring client.
  271. `event_type`::
  272. The default event type. Valid values: `trigger`,`resolve`, `acknowledge`.
  273. `attach_payload`::
  274. Whether or not to provide the watch payload as context for
  275. the event by default. Valid values: `true`, `false`.
  276. --