Filter Console information
Hey Apple people!
I'm wanting to trigger an automator workflow from a specific console item. I'm just having trouble filtering out the rest of the console results properly. Heres what Ive got so far.
Step 1 is a Run Shell Script:
syslog
Step 2 is where I need to filter the results. I tried using the existing "filter paragraphs" automator item but it doesnt return what I need.
The specific trigger is:
9/15/13 5:18:22.530 PM ApplicationName[5754]: And XML is <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Event>
<EventStateReady>
<EventName>EventStateReady</EventName>
<Message>Success</Message>
<InteractionId>Available</InteractionId>
</EventStateReady>
</Event>
There are up to 20 of these per day so I need it to trigger on the latest available.
What Ive been doing is using the "filter paragraphs" to search for ApplicationName but it only returns all instances of the line "5:18:22.530 PM ApplicationName[5754]: And XML is <?xml version="1.0" encoding="UTF-8" standalone="no"?>" and then using the following code to return the newest result.
on run {input, parameters}
return item -1 of input
end run
But what I need it to return the InteractionID of the newest syslog item.
I hope that makes sense! Any ideas on how to do this?
Thanks in advanced!