Splunk Search

How to retrieve the final value from the last instance of a field?

KyleMcDougall
Path Finder

Hello,

I'm trying to pull the final value for a product name. In a single event, we make multiple calls to an API for the product name and the product may change with each API call. I'm trying to build out a table for the final product name (the field doesn't change), but can't figure out what command to use.

Here's what I have so far. 

 

 

index=conversation crm_accounts_phone__product_name=*
| rename crm_accounts_phone__product_name as product
| stats latest(product)
| table product

 

 

 Appreciate any help!

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

If latest() is not working for you, try

| stats last(product)

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

If latest() is not working for you, try

| stats last(product)
Get Updates on the Splunk Community!

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...