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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

 (view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...