Splunk Search

Getting last of a column value in a table

AruBhende
Explorer

I have a splunk query that returns results like this.  I want to modify the query such that I get the latest row for UtilityJarVersion when everything else - other column values are same.   How can I modify my query to get the result I need?

BitBucket_ProjectMicroserviceNameEnv



_timeBitBucket_ProjectMicroserviceNameEnvUtilityJarVersion
1/13/22 4:09 PMbb-project1microservice1DEV1.0.105
1/11/22 6:39 AMbb-project2microservice2DEV1.0.105
1/12/22 11:22 AMbb-project2microservice2DEV1.0.106
1/12/22 7:00 PMbb-project3microservice3DEV1.0.106
1/12/22 9:28 AMbb-project3microservice4DEV1.0.106
1/12/22 6:33 PMbb-project4microservice5DEV1.0.106
1/11/22 6:40 AMbb-project5microservice6DEV1.0.105
1/12/22 6:43 PMbb-project5microservice6DEV1.0.106


That is, my expected result would look like

_timeBitBucket_ProjectMicroserviceNAmeEnvUtilityJar
1/13/22 4:09 PMbb-project1microservice1DEV1.0.105
1/12/22 11:22 AMbb-project2microservice2DEV1.0.106
1/12/22 7:00 PMbb-project3microservice3DEV1.0.106
1/12/22 9:28 AMbb-project3microservice4DEV1.0.106
1/12/22 6:33 PMbb-project4microservice5DEV1.0.106
1/12/22 6:43 PMbb-project5microservice6DEV1.0.106




Thank you

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

You should share your query, but in principle 

<YOUR QUERY>
| stats latest(_time) as _time latest(UtilityJarVersion) as UtilityJarVersion by BitBucket_Project MicroserviceName Env

Assuming you want the latest time version, as opposed to the latest Jar Version

 

View solution in original post

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You should share your query, but in principle 

<YOUR QUERY>
| stats latest(_time) as _time latest(UtilityJarVersion) as UtilityJarVersion by BitBucket_Project MicroserviceName Env

Assuming you want the latest time version, as opposed to the latest Jar Version

 

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 ...