Unable to attache pdf report

Hi

I am try-ing to send a pdf using the watch I get the following message:

Unable to get attachment of type [http] with id [dash_report.pdf] in watch [dash_report] aborting watch execution

I used the following watcher:

{
"trigger" : {
"schedule": {
"interval": "10m"
}
},
"actions" : {
"email_admin" : {
"email": {
"to": "'Recipient Name foo@bar.com'",
"subject": "Dashboard Monitoring Report",
"attachments" : {
"dash_report.pdf" : {
"http" : {
"content_type" : "application/pdf",
"request" : {
"method": "POST",
"headers": {
"kbn-xsrf": "reporting"
},
"auth": {
"basic": {
"username": "elkuser",
"password": "secret"
}
},
"read_timeout": "300s",
"url":
"https://0.0.0.0:5601/api/reporting/generate/dashboard/dashboard?_g=(time:(from:now-1d%2Fd,mode:quick,to:now))&sync"
}
}
}
}
}
}
}
}

Any suggestions?

Heya,

can you check the log files, if there is more information, like the HTTP response status code?

--Alex

Hey Alex,

I checked the logs. Indeed it struggles over the URL. Kibana is using ssl. However it uses a self-signed certificate. Is there a way to tell watcher it should not verify the verify the certificate?

Theo

Hey,

you can import that certificate into a truststore that is used by watcher. Run

keytool -importcert -keystore watcher-truststore.jks -file server.crt

And then specify the truststore in your elasticsearch.yml file

watcher.http.ssl.truststore.path: /path/to/elasticsearch/config/watcher-truststore.jks

--Alex