Home > Net >  Downloading PDF report from kibana/elasticsearch using API call
Downloading PDF report from kibana/elasticsearch using API call

Time:09-17

I am trying to generate PDF reports and download them using a script. I followed below instructions.

https://github.com/elastic/kibana/blob/master/docs/user/reporting/automating-report-generation.asciidoc

I am able to queue the report and i also got a download url ()/api/.../download/xyzdrfd but when i am trying wget on the url, It's not working. I have no idea how to download that report using APIs so just tried with wget.

Can anyone tell me how to download the reports from API call?

CodePudding user response:

The download might not be happening due to some redirects happening on the page. Use -L option with curl command to get it working. I did it specifically using the Kibana endpoint to download a PDF file. Replace the username and passsword with the basic auth credentials of yours. Use -o option to specify the downloaded file name. Below is the complete example of the command:

curl -L -u username:password -o download.pdf https://endpoint.com:9244/s/bi-/api/reporting/jobs/download/ktl8n95q001edfc210feaz0r
  • Related