Hi vikfnu,
yes, you can improve this search by not using join !
Nope, as long as you use join this will break sooner than later, because of all the obvious and hidden limits of the sub search http://docs.splunk.com/Documentation/Splunk/7.1.2/Search/Aboutsubsearches#Subsearch_performance_considerations
But back to your SPL, try this instead:
index=mine source=File4.csv OR source=File1.csv OR source=File2.csv OR source=File3.csv
| eval " Analysis Field4" = case(like(f1,"Y"), "Compliant", like(f2,"Y"), "NonCompliant")
| eval AnalysisField1 = case(like(field2,"Y"), "Compliant", like(field2,"N"), "NonCompliant")
| eval "Analysis Field3" = case (like(fa,"Y") AND (like(fb,"Y") OR like(fb,"N") ), "Compliant", like(fa,"N") AND (like(fb,"Y") OR like(fb,"N") ),"NonCompliant")
| eval JointAnalysisField1UField3=case (like("Analysis Field1”,”Compliant”) AND (like("Analysis Field3”,”Compliant”) OR like("Analysis Field3”,”NonCompliant”) ), "Compliant”, like("Analysis Field1”,”NonCompliant”) AND (like("Analysis Field3”,”Compliant”) OR like("Analysis Field3”,”NonCompliant”) ),"NonCompliant”)
| eval finalanalysis= if ( match( JointAnalysisField1UField3, "Compliant”) AND match ("Analysis Field1”,”Compliant”), "COMPLIANT”, if(match( JointAnalysisField1UField3, "NonCompliant”) AND match ("Analysis Field1”,”NonCompliant”), "NONCOMPLIANT”, "UNDEFINED))
| stats values(*) AS * by Field1
This will do the same as your multiple join search, it gets all various events from all 4 csv files and performs 'analytics' on them, and and shows results by Field1 .
To add more sources, sourcetype, and/or indexes simply expand the first base search by adding what you need.
One thing I noticed:
You use multiple variations of field names, like upper and lower case, added spaces in front, and so on.
You use ” instead of " - this is a big difference in SPL
If a field value is literal "Y" use it like this FA="Y" instead of like(FA,"Y")
Be consistent with filed names, and be sure to use the right " , also please read all the answer posts, you listed above, again. You found the right advice still you use join 😉
cheers, MuS
... View more