Create Timerange

Greetings,

Was wondering if someone could throw at me an example of how to use the Timerange in the expression language?

I'm currently trying something of the likes:

| var_set "timeToGo" value={timerange from="2022-03-29T23:56:25.129Z" to="2022-03-30T17:00:00.000Z"}

And it's throwing me an exception where the element is grayed out and there is no message popping up from said element.

Thank you in advance!

Hi,

As far as I can tell, it is related to the savedLens / savedMap / savedVisualization input parameters.

If your timerange is not static, you can pass such an object, and it will drive the time range of the embedded Kibana visualization.

var_set "timeToGo" value={timerange from="2022-03-20T23:56:25.129Z" to="2022-03-30T17:00:00.000Z"}
| savedMap id="..." center={mapCenter lat=47.56831 lon=7.53243 zoom=12.43} timerange={var name="timeToGo"}
| render

You can add this kind of saved object using the menu (+) Add element, and then Add from Kibana.

Looking at the code (kibana/x-pack/plugins/canvas), I don't see other uses of "timerange" outside these saved* embedded objects.

Hope this helps.

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