Splunk Search

Search to show mismatches in a version field

TheJagoff
Communicator

Hello,

The table below are the results from a REST query that shows the installed Apps/TA's from various servers (4 in the example) at my site.

| rest /services/apps/local | search disabled=0 core=0| dedup title |table label title version| collect index=test sourcetype=apps:installed

The following search produces the table below with Version mismatches highlighted in red:

index=test sourcetype="apps:installed"
| fillnull value="None" version, title
| table host label title version |rename label AS AppName | sort AppNam

hostAppNameLabelVersion
Server1Add-on for VMware ESXi LogsSplunk_TA_esxilogs4.1.0
Server2Add-on for VMware ESXi LogsSplunk_TA_esxilogs4.1.0
Server3Add-on for VMware ESXi LogsSplunk_TA_esxilogs4.0.0
Server1Add-on for VMware MetricsSplunk_TA_vmware_inframon4.1.0
Server1Add-on for Virtual CenterSplunk_TA_vcenter4.1.0
Server2Add-on for Virtual CenterSplunk_TA_vcenter4.1.0
Server3Add-on for Virtual CenterSplunk_TA_vcenter4.1.0
Server4Add-on for Virtual CenterSplunk_TA_vcenter4.1.0
Server1Add-on for ontapSplunk_TA_ontap3.0.0
Server1Ansible Monitoring & DiagnosticsAnsible_Splunk1.2.2
Server1Admin Authenticationall_adminauth0.1.0
Server2Admin Authenticationall_adminauth0.1.0
Server3Admin Authenticationall_adminauth1.0.0
Server4Admin Authenticationall_adminauth1.0.0

 

There is no entry in the results for a server if the App/TA isn't installed.

What I am asking for help on is a search that will show the entries that are mismatched on the "Version" field based on the "AppName" field. The rows where all versions match with the AppName can be ignored.

Thank you.

 

Labels (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

Ok. So if you want to simply leave those results where there is more than one version for a given app you can do - for example - something like this:

| eventstats dc(version) as number_of_versions by AppName
| where number_of_versions>1

At the end you can also aggregate your results with

| stats values(host) by AppName Label version

If you prefer it presented this way.

View solution in original post

TheJagoff
Communicator

There's no target version. I am looking for versions, based on the AppName that basically don't "agree" with each other. If 2 of the 3 servers have an App (with the same name) and the versions are 4.1.0 on 2 of them and 4.0.0 on the other, then I would like to see that. If they all match on the AppName and Version, no need to see it.

Thanks

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Ok. So if you want to simply leave those results where there is more than one version for a given app you can do - for example - something like this:

| eventstats dc(version) as number_of_versions by AppName
| where number_of_versions>1

At the end you can also aggregate your results with

| stats values(host) by AppName Label version

If you prefer it presented this way.

yuanliu
SplunkTrust
SplunkTrust

This eventstats needs to be grouped by app

| eventstats dc(version) as number_of_versions by AppName
| where number_of_versions>1

PickleRick
SplunkTrust
SplunkTrust

Yes, missed that. Fixing.

0 Karma

TheJagoff
Communicator

Perfect! Thank you both!

0 Karma

PickleRick
SplunkTrust
SplunkTrust

What do you mean by "mismatched" here? Your results don't show a "target" version.

You can find the version with the highest count. You could find the highest version number...

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...