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!

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...