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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...