Splunk Search

How to apply the condition in multivalue event?

VsplunkV
Explorer

Splunk Experts,

How to write the eval command to compare the Multivalue, Below is data,

    **Servicename**    **Status**                                          ServerName
                                                                              NGS121
     Ad_service          Running
     CIM_service         Running
      Jabber             NotRunning
      Citrix             NotRunning.

IF any of the Status is "NotRunning" I should get the ServiceStatus as "Not-Running" O/P as

Servername                 ServiceStatus

NGS121                     Not-Running
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try like this

your current search giving multivalued field Status and other fields
| eval Status=if(isnotnull(mvfilter(Status,"NotRunning")),"NonRunning","Running")

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try like this

your current search giving multivalued field Status and other fields
| eval Status=if(isnotnull(mvfilter(Status,"NotRunning")),"NonRunning","Running")

VsplunkV
Explorer

Thank you. It worked

0 Karma

elliotproebstel
Champion

This will create a field called ServiceStatus and assign it the value Not-Running if any value for Status is set to NotRunning, and then it will retain only the events where ServiceStatus="Not-Running":

[ your existing search ]
| eval ServiceStatus=if(like(Status, "NotRunning"), "Not-Running", "Running")
| where ServiceStatus="Not-Running"
| fields ServerName ServiceStatus

VsplunkV
Explorer

Thank you. It worked.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...