Thanks again for your help,
I've tried your query by tweaking it a little bit as I am actually looking for a different output because the fields Comment, DESC and Maintenance I am trying to show or populate in the output are existing only in the lookup file and not in the logs.
This is the query that is working for me, I've tested this query by forcefully removing a server name from the main/top search and I am able to see the same server name in the results with a zero count and I believe this query will not pose any auto-finalizing issues moving forward:
index="nix" sourcetype="ps" USER="web" host IN(server1, server2, server3, server4) ARGS="*process.conf"
| dedup host PID
| rex field=ARGS "\/conf\/(?\w+.*)"
| rename host as SERVER_NAM
| stats count by SERVER_NAM,PROCESS_NAME
| append
[| inputlookup process.csv
| eval count=0]
| stats sum(count) as count by SERVER_NAM,PROCESS_NAME
| lookup AEM_MCC_STL_KSC_apache_process_monitor_list.csv SERVER_NAM as SERVER_NAM, PROCESS_NAME as PROCESS_NAME OUTPUT SERVER_NAM as SERVER_NAM, PROCESS_NAME as PROCESS_NAME, Comment as Comment, DESC as DESC, Maintenance as Maintenance
| where count=0 AND isnull(Maintenance)
| fields SERVER_NAM,PROCESS_NAME, Comment, DESC
Basically I am trying to match or compare the SERVER_NAME and PROCESS_NAME fields between the logs and lookup file and if the count from the logs and lookup file matches that means the process/host is down and additionally I am trying to include the fields Comment, DESC and Maintenance for user to understand the fields and to control the alerting by setting the Maintenance field to YES during the maintenance to suppress the alerts.
... View more