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!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out &gt;&gt; As our brave ...