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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...