Automatically generate and send kibana dashboard reports via an Email

3.4k views Asked by At

I have a 3 node cluster of ELK (all version 6), on 1st node i have Elasticsearch and Kibana, on 2nd i have Elasticsearch and Logstash and on 3rd i have only Elasticsearch which is a Ingest node.

I have 4 servers which sends me data via filebeat and metricbeat.

Now all are working fine, i even have X-Pack version 6 Now there is manual process of generating pdf of dashboards i tried that.

I want to automatically generate reports at certain time and email it to me.

I read about watchers and email configuration in elasticsearch.yml file and i did that ..

But i want it to be done automatically. And i am not trying skidler and phantomJs.

If anything i am missing, help me out Thank You.

1

There are 1 answers

0
xeraa On BEST ANSWER

Here is an example from the documentation on how to generate a report with Watcher:

PUT _xpack/watcher/watch/error_report
{
  "trigger" : {
    "schedule": {
      "interval": "1h"
    }
  },
  "actions" : {
    "email_admin" : { 
      "email": {
        "to": "'Recipient Name <[email protected]>'",
        "subject": "Error Monitoring Report",
        "attachments" : {
          "error_report.pdf" : {
            "reporting" : {
              "url": "http://0.0.0.0:5601/api/reporting/generate/dashboard/Error-Monitoring?_g=(time:(from:now-1d%2Fd,mode:quick,to:now))", 
              "retries":6, 
              "interval":"1s", 
              "auth":{ 
                "basic":{
                  "username":"elastic",
                  "password":"changeme"
                }
              }
            }
          }
        }
      }
    }
  }
}

Basically you just need an API call to get this done.