@LH_SPLUNK, ususally source
name is fully qualified path of your source i.e. besides the file name it will also contain the path details. So, your condition should not find an exact match of the source filename rather than it should be a pattern of ending with filename. Following is a run anywhere example illustrating the difference in your approach vs regular expression pattern match for source using match()
| makeresults| eval source="source_a.csv,source_b.csv,/blah/blah/source_a.csv,/blah/blah/source_b.csv"| makemv source delim=","| mvexpand source| eval A=if(source == "source_a.csv", "1" , "0")| eval B=case(match(source,"source_a.csv$"),"1",match(source,"source_b.csv$"),"0")
PS: like()
option suggested by @nickhillscpl, should also work. match()
is case sensitive.
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"