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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...