I've created a report that will query the scripting logs on the computers, and output the machine name, the time the script was run and the status logs from the script. I'm having a hard time filtering this query, 1 - so that it will display only the most recent log per machine (right now it displays all of the logs for the script name "McAfee Add-in Check"), and 2 - filter by what is in the status field. I've tried using Max() and "Limit 1" - but I don't think I'm using them correctly, can anyone help?
MACHINE Left Join
KBOT_LOG On MACHINE.ID = KBOT_LOG.MACHINE_ID Left Join
KBOT On KBOT.ID = KBOT_LOG.KBOT_ID Inner Join
KBOT_LOG_DETAIL On KBOT_LOG.STATUS_DETAIL_ID = KBOT_LOG_DETAIL.ID
KBOT.NAME Like 'MCAFEE ADD-IN CHECK'
Here is the actual code I was able to use. To modify just change "ScriptName" and "ScriptStatus" below.
LEFT JOIN MACHINE on KBOT_LOG_LATEST.MACHINE_ID = MACHINE.ID
LEFT JOIN KBOT_LOG on KBOT_LOG_LATEST.KBOT_LOG_ID = KBOT_LOG.ID
LEFT JOIN KBOT on KBOT_LOG_LATEST.KBOT_ID = KBOT.ID
LEFT JOIN KBOT_LOG_DETAIL on KBOT_LOG.STATUS_DETAIL_ID = KBOT_LOG_DETAIL.ID
KBOT.NAME LIKE 'ScriptName' AND
KBOT_LOG_DETAIL.TEXT LIKE 'ScriptStatus'