Splunk Search

EVAL for multiple conditions check

davidcraven02
Communicator

I have a search which checks if the values within con_splunkUL exist within con_UL (or visa versa).

I need a field created called "Action" which checks this and also if the word "Hosting" exists in the Path field. If this is met then value should be 'Action Required' and if not then 'No Action Required'

search source="otl_varonis_monitoring.csv" host="opspksh01d.options-it.com" sourcetype="csv" type=Production 
        | eval con=machine. "," .drive 
        | eval con_UL = upper(con)] 
    | eval MonitoringStatus = if(like(con_splunkUL,"%".con_UL."%"), "Monitored", "Not Monitored") 
    | eval drive = Path 
    | rex field=drive "(?P<Drive>\w+)\:" 
    | dedup machine, Drive, Path, MonitoringStatus 
    | table machine, Drive, Path, MonitoringStatus, type
Tags (2)
0 Karma

493669
Super Champion

@davidcraven02 Can you try below:

eval Action=if ((MonitoringStatus="Monitored")AND(like(Path,"%Hosting%")),"Action Required","No Action Required")
Get Updates on the Splunk Community!

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...

Cloud Platform & Enterprise: Classic Dashboard Export Feature Deprecation

As of Splunk Cloud Platform 9.3.2408 and Splunk Enterprise 9.4, classic dashboard export features are now ...