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
Revered Legend

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
Revered Legend

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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...