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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...