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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...