How Make Select Case When from ElasticSearch


I have an integration between Grafana and SQL Server, but I want to change to ElasticSearch, but I need to know how to do this query in Grafana with for ElasticSeacrh:

case when dbo.access.time> 45000 or dbo.access.cod_status = 500 then 0 else 100 end as 'Uptime'
$ __ timeFilter (dbo.access.time) "

How I do it so that it works for me in ElasticSearch assuming it has the same fields.

Please your help.

This could help:

If you use then you can see what is generated behind the scene.

1 Like

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