有没有办法将kibana仪表板png报告放入电子邮件正文中

时间:2019-12-03 04:25:22

标签: kibana

从文档中可以使用Watcher作为附件在Kibana中生成电子邮件报告,但是是否可以将PNG添加为电子邮件的一部分?在电子邮件正文中嵌入图像。

似乎有一个body.html选项,有人使用过吗?

https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#email-action-attributes

2 个答案:

答案 0 :(得分:0)

我想别人都想弄清楚这个...

 "actions": {
    "email_report": {
      "email": {
        "profile": "standard",
        "attachments": {
          "weekly_report.png": {
            "reporting": {
              "url": "http://url.com",
              "retries": 10,
              "interval": "5m",
              "inline": true,
              "auth": {
                "basic": {
                  "username": "abc",
                  "password": "password"
                }
              }
            }
          }
        },
        "to": [
          "sm@email.com"
        ],
        "subject": "Daily - Monitoring Report",
        "body": {
          "html": "<p><b> Summary - 2 Week Trend <b><p> <img src=weekly_report.png>"
        }
      }
    }
  }

答案 1 :(得分:0)

虽然之前的答案 (S. Magesh) 确实涵盖了手表的 json,但至少在 7.13 中,您还需要调整清理以允许内联 img-s。

这是在 elasticsearch.yml 中使用以下内容完成的:

xpack.notification.email.html.sanitization:
  allow: body, head, _tables, _links, _blocks, _formatting, img

所以,

1. <img src=your_image.png> in body.html on the watch
2. "inline": "true" under "reporting" on the watch
3. override default sanitization to allow img in elasticsearch.yml