Splunk Search

Use fillnull to fill in different values within same field?

rfranco83
New Member

Hi All,

I am trying to use the fillnull to populate empty values within the same field with unique values. For example, the first empty value found in field1, insert unknown1. The second empty value found in field1, insert unknown2, etc...

Any suggestions?

0 Karma
1 Solution

nickhills
Ultra Champion

Assuming all the events have a null, or you just need them to be unique (not sequential) try this:

|streamstats count as ct|eval yourNullField=if(isnull(yourNullField),"Unknown "+ct,yourNullField)
If my comment helps, please give it a thumbs up!

View solution in original post

0 Karma

nickhills
Ultra Champion

Assuming all the events have a null, or you just need them to be unique (not sequential) try this:

|streamstats count as ct|eval yourNullField=if(isnull(yourNullField),"Unknown "+ct,yourNullField)
If my comment helps, please give it a thumbs up!
0 Karma

rfranco83
New Member

Thank you for your reply.
What that did was fill in the empty values all the same with "Unknown" and "# of events" for a particular field. Example: Within MyField1 all empty values show "Unknown 500". What I am trying to do is increment the value so all the empty values in MyField1 are unique.

0 Karma

nickhills
Ultra Champion

sorry - use streamstats, not event stats.

edited answer

If my comment helps, please give it a thumbs up!
0 Karma

rfranco83
New Member

That works, thank you!! I appreciate the quick response.

0 Karma
Get Updates on the Splunk Community!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...