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.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

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