How to put Kibana Dashboard PNG inline in the body of automated email using Watcher?

I am using Kibana 7.5.0.

I am trying to use Watcher to send automated emails of Kibana Dashboards on a schedule.

I've read this documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html

I am able to successfully have Watcher send emails of Kibana dashboards with the PDF or PNG as an attachment.

However, I'd like for the email to have the PNG inline in the body of the email.

I read this post where someone says they were able to successfully do this: Is there a way to put kibana dashboard png report in the body of the email

I'm using a copy of their Watcher code, but it's not working for me. The email is sent with PNG as an attachment, not inline in the email body. I am receiving this email in Gmail, if that matters.

Here's what my Watcher code looks like:

{
  "trigger": {
    "schedule": {
      "interval": "15m"
    }
  },
  "input": {
    "none": {}
  },
  "condition": {
    "always": {}
  },
  "actions": {
    "email_report": {
      "email": {
        "profile": "standard",
        "attachments": {
          "test_report.png": {
            "reporting": {
              "url": "the URL I get from the Kibana dashboard --> Share --> PNG Reports --> Copy POST URL",
              "retries": 3,
              "interval": "5m",
              "inline": true,
              "auth": {
                "basic": {
                  "username": "reporting_user",
                  "password": "::es_redacted::"
                }
              }
            }
          }
        },
        "to": [
          "my_email@gmail.com"
        ],
        "subject": "Test Report - PNG Inline Version",
        "body": {
          "html": "<p><b> Summary - 2 Week Trend <b><p> <img src=test_report.png>"
        }
      }
    }
  }
}

What am I doing wrong? Is there some other configuration I need to do to make this work?

Thanks.

1 Like

only difference i see from what i am using is the single quotes like so

<img src='test_report.png'>
1 Like

Thanks for the reply.

Even when I add single quotes like you showed, it is not working.

Are you able to share an example of your Watcher code that is working? Of course with any confidential information removed.

Did you have to do any other configuration changes to get this to work? Did you make any changes to the HTML sanitization settings, etc.?

Thank you, I appreciate your help on this.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.