Assume I have a table like this:
Time Machine State
10/07/2017 5:15:00 PM M1 On
11/07/2017 5:50:00 PM M1 Off
11/07/2017 6:05:00 PM M2 On
11/07/2017 9:15:00 PM M2 Off
11/07/2017 9:25:00 PM M2 On
I want to plot a linechart telling status of each machine at interval of every 5 minutes.
I tried this query:
| timeslice 5m
| parse "machine=* " as machine
| parse "state=* " as state
| if(state="On",1,0) as State
| last(State) as StateChange by _timeslice,machine
| transpose row _timeslice column machine
But this just connects all dots as 1 and 0 and creates a seasaw kind of graph.
I want to display a square wave with states filled with last available state for each machine at interval of 5 minutes.
Please sign in to leave a comment.