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!

New Dates, New City: Save the Date for .conf25!

Wake up, babe! New .conf25 dates AND location just dropped!! That's right, this year, .conf25 is taking place ...

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...

Observability protocols to know about

Observability protocols define the specifications or formats for collecting, encoding, transporting, and ...