Exporting a Timelion PNG at a certain date

Hello everyone,

I'm a beginner of Elastic/Kibana and I'm really struggling to find a topic talking about what I want on Google so here I am and I hope you can help me.

So, I have a Timelion visualization and I want to export it as a PNG to put it in a Word document via a PHP script. The problem is, I want to be able to put a time range in the PHP code and add it to the Dashboard POST URL and then curl it into an image. The time range would be generated from my website.

Is it possible this way or another ? I can't find something close to it on the forums etc.. Maybe with an API ?

Thank you for your help !

The POST url you can copy from the dialog on Dashboard or Visualize is the API to fetch a report - the time range is part of that. A small example:

This is my visualization - notice the "Last 24 hours" in the time picker.

Now I'm copying the POST url:

This gives me:

it looks really messy, but around halfway through there's this part:

This is the value of the current time picker - it's the html encoded version of time:(from:now-24h,to:now) which in turn is the rison encoded version of this JSON snippet: "time": { "from": "now-24h", "to":"now"}. You can generate this URL inside your PHP script and switch out now-24h and now with your desired time range programatically. It also takes absolute dates as an ISO string, play around with the Kibana UI and generate the URL to see how it behaves.

Hi Joe,

That is exactly what I wanted, thank you for clarification, really appreciated !

Have a good day,

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