How to format date in ESSQL?

I'm using ESSQL in Kibana Canvas to plot a line chart. I have a field date and want to group my data by "YEAR-MONTH".

My query is something like this:

SELECT date, duration FROM my_index GROUP BY date

but I need something like this:

SELECT DATE_FORMAT(date, 'YYYY-MM') as date, duration FROM my_index GROUP BY date

Is there any workaround to achieve this?

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