Splunk Search

How do I hide rows if a field matches a certain value?

jiaqya
Builder

i have 2 columns , one which has install status and the other which has the exception status.
install status has yes/no AND exception status has "exception/no"

if i find "exception" in this field, then i would like to hide all rows which contains that field=exception.

is this possible?

the pattern match value is coming from a drill down input. So if a user clicks on "Exception", i still need to show that, so cannot use the !="exception".

Tags (1)
0 Karma
1 Solution

jiaqya
Builder

Got this fixed by adding below code.

|eval mytext = if((Name ="No" AND Exception="Exception" ), "ExcludeThisRecord","NoNeedToExclude")
|search NOT mytext="ExcludeThisRecord"

View solution in original post

0 Karma

jiaqya
Builder

Got this fixed by adding below code.

|eval mytext = if((Name ="No" AND Exception="Exception" ), "ExcludeThisRecord","NoNeedToExclude")
|search NOT mytext="ExcludeThisRecord"

0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

Assuming you are extracting that field already, you can just filter that out in your base search. For example:

index=YOUR_INDEX sourcetype=YOUR_SOURCETYPE YOUR_FIELD!="exception" |
table _time YOUR_FIELD ANOTHER_FIELD

Making assumptions on your search in general, but that would be the easiest way.

0 Karma

jiaqya
Builder

Morris, thanks for your response.

the pattern match value is coming from an drilldown input.
so if user clicks on "Exception" i still need to show that, so cannot use the !="exception".

i am not able to explain the scenario here , but ill try.
i have 2 columns , one which has install status and the other which has the exception status.
install status has yes/no AND exception status has "exception/no"

so if input value is yes, i get all the yes, irrespective of exception status, bcoz yes means installed, so thats ok
if input values is exception, then irrespective of install status, it will show exception, this is also ok
now problem i have is with "no", if install status is "no" and exception status is "exception", then i would like to exclude the exception systems out of "no" click report.

so i was looking at some solution , which after the report output can exclude exception="exception" rows in case "install status"="no"

hope the problem is explained..
sorry for long write up.

0 Karma

jiaqya
Builder

Think this can be done with search not, can any of you provide me a syntax where in i can do a search not when a column value=matches a pattern. thanks.

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...