This query works:
query="
SELECT
COUNT(1) as value
FROM "drs-fija-order"
WHERE 1 = 1"
This doesn't:
query="
SELECT
COUNT(1) as value
FROM "drs-fija-order"
WHERE 1 = 1
and @timestamp > NOW() - interval 1 hour"
How do I filter using @timestamp ?
jsanz
(Jorge Sanz)
March 28, 2025, 12:21pm
2
Use dobule quotes as in "@timestamp" - NOW()...
Tested directly in the Console
Yields same result as in Discover to me:
Hi Jorge! Thanks for the reply.
It didn't work though. This is what I tried:
kibana
| essql timezone="CET"
query="
SELECT
COUNT(1) as value
FROM "drs-fija-order"
WHERE 1 = 1
and "@timestamp " > NOW() - interval 1 hour
"
| math "value"
| metric "Last hour"
metricFont={font align="right" color="#444444 " family="'Open Sans', Helvetica, Arial, sans-serif" italic=false size=96 underline=false weight="bold"}
labelFont={font align="left" color="#444444 " family="'Open Sans', Helvetica, Arial, sans-serif" italic=false size=36 underline=false weight="normal"} metricFormat="0"
| render
I also tried with double double quotes. ""@timestamp ""
Oh I solved it. Of course, you had to escape the double quotes. \ "@timestamp \ "