Splunk Search

Multivalue fields match issue

mbasharat
Builder

Hi,

I have below sample dataset. This dataset is for an asset being compliant or not compliant. What I need is:

  • If an asset is tagged as compliant for some values and non compliant for some, I need non compliant to take precedence and show it as non compliant. Right now, I am seeing all values for example for asset1.
  • If an asset is compliant only, it stays as Compliant.
  • If an asset is NA only, it stays as Compliant.

Is:

1.png

To Be:

2.png

Thanks in-advance!!!

Labels (5)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @mbasharat,

Please try below after your base search;

| stats values(Status) as Status by DNS
| eval Status=case(Status="Non_Compliant","Non_Compliant",Status="NA","Compliant",1=1,Status)

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @mbasharat,

Please try below after your base search;

| stats values(Status) as Status by DNS
| eval Status=case(Status="Non_Compliant","Non_Compliant",Status="NA","Compliant",1=1,Status)

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...