Question

I am using AWS Timestream so the DB structure is a bit different than normal but effectively it fairly similar to a normal structure. What I need to do: When an error message of a certain type (Ie measure_name = "DriveError") I would like to query that error message and the last value of of several other measures all of which will have a different measure_name. The point of this is to help quickly view my systems state when that error occurred. I am using this to watch a machines in a factory so the values are not server related but one could basically view an example as : *An error occurs, report in a table: the error, the the cpu temp, the cpu utilization, the fan speed, ect. *

The following would be the normal way I could select a error message

SELECT time, measure_value::varchar AS error
from "Main"."Machine1"
where measure_name = 'DriveError'
ORDER BY 
    time DESC

But in this case what I will need to is select the last value of all my drive parameters (again each has its own measure_name) when there is measure_value::varchar with measure_name = DriveError.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top