Hi guys,
I'm trying to control whenever I have to send an event to ServiceNow or not, and that's what I've done so far.
Basically, I need to check if the query results exceed a threshold. If it does, I need to update a lookup with that value and run a snoweventstream command with severity > 0.
If the result is below the threshold, I need to do the same update in the lookup with that value and run a snoweventstream command with severity = 0.
Have any of you guys already done something similar and do you have some ideas on how I can perform that?
This is basically a draft of what it would be (in a high level):
eval lastStatus=(subsearch inputlookup x.csv | get status where alert_name = something)
MyQuery
if fieldA > 10
then
if (lastStatus == 0)
then append x.csv fieldB, fieldC, 1
AND eval alerted=(subsearch that eval some fields and trigger snoweventstream command with severity 1)
else if (lastStatus == 1)
then append x.csv fieldB, fieldC, 0
AND eval alerted=(subsearch that eval some fields and trigger snoweventstream command with severity 0)
Thank you in advance!
... View more