Splunk IT Service Intelligence

I am Running is query where i am using lookup and i want data for only paths which are in lookup file.but when i run this ,the query giving data for those are not even added in lookup file.

Hemant1
Explorer
index=esbsrvprod sourcetype=foldermonitoringError NOT (.log) NOT (.nfs)|eval Instance=case(like(host,"%EU1%"),"EU1", like(host,"%EU3%"),"EU3", like(host,"%EU2P%"),"EU2",like(host,"%AP%"),"AP",like(host,"%AM%"),"AM",like(host,"%CI%"),"CI") | rex field=filePath /(?<folder>.*)/ |  lookup FolderMonitorings.csv Folder as folder, Instance as Instance OUTPUT ThresholdFiles, "Assignment Group" MonType  |  eval folder=replace(folder,"mnt/integration","")  | chart limit=10000 count over Instance by folder
0 Karma

yannK
Splunk Employee
Splunk Employee

You can use a sub search to call the lookup and return an OR condition , to use as a search condition.

<my search> [ | inputlookup mylookup | table A ] 

will become

<mysearch> A=x OR A=y OR A=z 

for more complex conditions, look at the command format
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Format

0 Karma

renjith_nair
Legend

@Hemant1,
The initial answer was based on other assumptions and hence removed. Since you need to count the actual events ,
Look for those events which are not matching, ie. for e.g. if there are no matches in the lookup , then probably the MonType will be empty for those events. So adding a condition |search MonType!="" should filter the unmatched events

---
What goes around comes around. If it helps, hit it with Karma 🙂

Hemant1
Explorer

@renjith.nair

yes , i have tried it but didn't work . i want only those paths which are in lookup .can you please suggest some modified query which could help me . please

0 Karma

renjith_nair
Legend

@Hemant1,
Do you have all the fields, for e.g. MonType has value for unmatched events? If they are null, try
|where NOT isnull(MonType) before the chart command and verify

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...