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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...