Splunk Search

How to Remove the null values in a field for particular type only.

vinod743374
Communicator

HI,

I have a single query to get all types of data in table.
for one particular type I have an issue with the null values, i need to remove those null value results for the particular type only without effecting the other types of data.

vinod743374_0-1711167321001.png

I need to remove those null values in that "error message" field for type 1 , for Type 2 it should be as it is.


Thanks in advance.

Labels (3)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

The question is next to unanswerable.  First, what does "type" mean?  Is that a field name?  Attempting to show data using screenshot is bad enough, but the screenshots only includes one column.  Do we assume that there is another column named "type", and the values are "type1" and "type2"?  Pro tip #1: Illustrate data in text.  Tabulate with mock values if you want to anonymize.

Second, what does "remove" mean?  Do you want to remove the row that contains null value in this field named "error message"?  As if using single-column screenshot is not confusing enough, your screenshot shows a heading "ErrorMessage" with so-called camel case and no space.

Now, forget type because it doesn't seem to have any bearing in the question, just add to overall confusion. If you ask how to remove a row with null value in a given field such as one named "error message", all you need to do is to test it using isnull or isnotnull.

| where isnotnull('error message')

Is this what you ask?

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @vinod743374 ,

use eval:

| eval ErrorMessage=if(ErrorMessage="Type1","Your message for Error Type 1",ErrorMessage)

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

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