Splunk Search

how do I find the different packages installed on two hosts?

Simeon
Splunk Employee
Splunk Employee

I have a scripted input that takes in rpm -qa output and want to find out the difference in packages installed on two hosts. What kind of search can get this done?

Tags (1)
0 Karma
1 Solution

Simeon
Splunk Employee
Splunk Employee

For an rpm -qa output, you will need to create multiple values via multikv and leverage a sub search that returns the packages that exist on one of the hosts:

host=host1 sourcetype=rpm | multikv noheader=t | rex "(?\S+)" | search NOT [search host=host2 sourcetype=rpm | multikv noheader=t | rex "(?\S+)" | fields package] | table package host

It is important to note that this solves the problem of using "diff", as that will not give you discrete package information.

View solution in original post

0 Karma

Simeon
Splunk Employee
Splunk Employee

For an rpm -qa output, you will need to create multiple values via multikv and leverage a sub search that returns the packages that exist on one of the hosts:

host=host1 sourcetype=rpm | multikv noheader=t | rex "(?\S+)" | search NOT [search host=host2 sourcetype=rpm | multikv noheader=t | rex "(?\S+)" | fields package] | table package host

It is important to note that this solves the problem of using "diff", as that will not give you discrete package information.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...