- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VsplunkV
Explorer
02-21-2018
01:01 PM
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
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
02-21-2018
02:44 PM
Try like this
your current search giving multivalued field Status and other fields
| eval Status=if(isnotnull(mvfilter(Status,"NotRunning")),"NonRunning","Running")
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
02-21-2018
02:44 PM
Try like this
your current search giving multivalued field Status and other fields
| eval Status=if(isnotnull(mvfilter(Status,"NotRunning")),"NonRunning","Running")
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VsplunkV
Explorer
02-21-2018
02:53 PM
Thank you. It worked
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
elliotproebstel
Champion
02-21-2018
02:12 PM
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
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VsplunkV
Explorer
02-21-2018
02:52 PM
Thank you. It worked.
