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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...