Splunk Search

How to extract latest event for unique account numbers?

srive326
Explorer

Hello,

I'm trying to extract some fields for the latest event based on unique account numbers. I've tried using latest(field) but the issue I'm running into is for example:
Event date: 9/20/2019 field_of_interest: NULL
9/19/2019 field_of_interest: "04/09/2019"
9/18/2019 field_of_interest: NULL

When I do latest(field_of_interest) I'm being returned "04/09/2019" when I want to retrieve the NULL from 09/20/2019.
I've read other answers that lead me to believe I may need to do latest(_raw) and look for the field with a regex but maybe there is another approach?

Thank you in advance for your help in this, I hope the question is clear!

0 Karma

srive326
Explorer

I found a solution in another post which is to fill the NULL values with the string "NULL"
| fillnull field_of_interest value="NULL" | latest(field_of_interest)

0 Karma

srive326
Explorer

I found a solution in another post which is to fill the NULL values with the string "NULL"
| fillnull field_of_interest value="NULL" | latest(field_of_interest)

0 Karma

richgalloway
SplunkTrust
SplunkTrust

@srive326 If your problem is resolved, please post an answer and accept it to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...