json_extract(events_persisted.payload,'$.data.FocusLostCount')as'FocusLostCount',-- Number of times that an app lost focus during the aggregation period
-- Version of the application that produced this event
casewhensubstr(json_extract(events_persisted.payload,'$.data.AppId'),1,1)is'W'-- Windows Application x32/x64
json_extract(events_persisted.payload,'$.data.MouseInputSec')as'MouseInputSec',-- Total number of seconds during which there was mouse input (In Seconds)
time(json_extract(events_persisted.payload,'$.data.InFocusDurationMS'),'unixepoch')as'InFocusDuration',-- Total time (in milliseconds) the application had focus
time(json_extract(events_persisted.payload,'$.data.UserActiveDurationMS'),'unixepoch')as'UserActiveDuration',-- Total time that the user was active including all input methods