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!

Deep Dive into Federated Analytics: Unlocking the Full Power of Your Security Data

In today’s complex digital landscape, security teams face increasing pressure to protect sprawling data across ...

Your summer travels continue with new course releases

Summer in the Northern hemisphere is in full swing, and is often a time to travel and explore. If your summer ...

From Alert to Resolution: How Splunk Observability Helps SREs Navigate Critical ...

It's 3:17 AM, and your phone buzzes with an urgent alert. Wire transfer processing times have spiked, and ...