Matrix Hookshot

Mirror alerts into a Matrix room using Hookshot-compatible webhooks. Use matrixhookshot with the room webhook URL and formatting options. Add matrixhookshot under alert: on your rule (you can combine destinations). See Hookshot webhook handling (opens in a new tab) for how URLs and payloads work on the Hookshot side.

Options covers each YAML field—required first—with snippets under some keys. Full working example at the bottom is a complete rule for the Logit.io alert editor.

Options

Keys below match the ElastAlert 2 alerter. Shared rule fields such as alert_subject apply as described in Subject & body. Example fragments from the ElastAlert 2 reference appear indented under the option they illustrate (add your own name, type, index, and filter to make a full rule).

Required

  • matrixhookshot_webhook_url — The webhook URL that was provided to you by the hookshot bot. For example, https://example.com/webhook/6de1f483-5c4b-4bb8-784a-f09129f45225. You can also use a list of URLs to send to multiple webhooks.

Optional

  • matrixhookshot_username — Optional username to prepend to the text body.

  • matrixhookshot_text — Override the default alert text with custom text formatting.

  • matrixhookshot_html — Specify HTML alert content to use instead of the default alert text.

  • matrixhookshot_proxy — By default ElastAlert 2 will not use a network proxy to send notifications to Hookshot. Set this option using hostname:port if you need to use a proxy. only supports https.

  • matrixhookshot_ignore_ssl_errors — By default ElastAlert 2 will verify SSL certificate. Set this option to True if you want to ignore SSL errors.

  • matrixhookshot_timeout — You can specify a timeout value, in seconds, for making communicating with Hookshot. The default is 10. If a timeout occurs, the alert will be retried next time ElastAlert 2 cycles.

  • matrixhookshot_ca_certs — Set this option to True or a path to a CA cert bundle or directory (eg: /etc/ssl/certs/ca-certificates.crt) to validate the SSL certificate.

Full working example

name: Example alert for Matrix Hookshot
type: any
index: "*-*"
filter:
  - query:
      query_string:
        query: "level:error OR log.level:error"
alert:
  - "matrixhookshot"
matrixhookshot_webhook_url: "https://hookshot.example/webhook/..."