I'm basically trying to identify whether some of my hosts are not doing something successfully as it should be in a daily basis, and alert as needed.
The process would output specific line if the task is successful and I only need to match once.
so I'm been trying to do sub-search without much success.
my searches so far:
try 1:
sourcetype="myapp" | dedup host | eval allhost=host | eval joinf=1 | join max=0 joinf [search sourcetype="myapp" "Database updated" | dedup host | eval updatedhost=host | eval joinf=1] | eval match=if(allhost==updatedhost, 1,0)
try 2:
sourcetype="myapp" | dedup host | stats dc(host) as allhost | appendcols [search sourcetype="myapp" "Database updated" | dedup host | stats dc(host) as updatedhost ] | eval nodiff=if(match(allhost,updatedhost),"True","False") | table nodiff
^^^ this only match total host count which I need more details (ie. which host does NOT match)
try 3:
sourcetype="myapp" OR (sourcetype="myapp" "Database updated") | streamstats count by host | stats values(host) as host | mvexpand host | eval Status = if(match(host), "MATCH","NO MATCH") | table host,Status
^^^ not working since I don't know how to identify the second set of 'host' for the match
... View more