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!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...