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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...