How to display @timestamp as SGT rather than UTC in Canvas

Hello,

I am playing around in Canvas and was trying to write an ESSQL query to show CPU usage. However, the timestamp shown is always in UTC time and i am unable to cast it to local time (SGT).

SELECT "@timestamp" as Time, system.cpu.user.pct*100 as "CPU USAGE" FROM "metricbeat-*" order by "@timestamp" DESC
This is my current query and how can i cast the UTC timestamp to + 8 hours?

I manually added 8 hours to timestamp to display the local time but i am not sure if this is proper or not...

SELECT CAST("@timestamp" AS DATETIME) + INTERVAL 8 HOURS AS result, system.cpu.user.pct*100 as "CPU USAGE" FROM "metricbeat-*" order by "@timestamp" DESC

Is there a proper method to do this? or my way is fine?

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