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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...