Splunk Search

How do I group software versions together

dbendixen
Explorer

I have a query that tells me the count of unique devices running a particular software version (major.minor.release.build format--x.x.x.x). I'd like to group on the "release" or 3rd digit in the group. So if I have the following versions:

1.1.2.45
1.1.2.47
1.1.2.36
1.1.3.45
I'd like to to really just see this in the output:
1.1.2
1.1.3

Right now my query looks something like this:

index=stats_sess | stats dc(device.uuid) as count by software.version | sort 10 count d | table software.version, count

Tags (4)
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try this

index=stats_sess  | eval software.version=replace('software.version',"(.*)\.(\d+)$","\1")| stats dc(device.uuid) as count by software.version | sort 10 count d | table software.version, count

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try this

index=stats_sess  | eval software.version=replace('software.version',"(.*)\.(\d+)$","\1")| stats dc(device.uuid) as count by software.version | sort 10 count d | table software.version, count

dbendixen
Explorer

Thank you! This is exactly what I needed.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...