Splunk Search

Searching For New Packages in Unix

essklau
Path Finder

Hi.

I am trying to find a way to search Unix for new packages. The approach only needs to compare today's list of packages to yesterday's list and display the package/version/"time first seen" of packages that appear today, but not yesterday.

My search starts index=os sourcetype=package, and the values of package are tabled, but can be split with multikv to shows fields for NAME, VERSION, and other fields.

It seems like the easiest approach would be to create a by-host list of NAME values for the last package entry of yesterday, a by-host list of NAME values now, take the values from the now list which don't appear in the past list, and look for those NAME values' first occurence. Finally, return the NAME/Version/first occurence.

I'm stuck though at the beginning, because I'm not sure how to set aside/collect yesterday's values for comparison with whatever i come up with for today's list.

Any takers?

Thank you.

Tags (1)
0 Karma

dwaddle
SplunkTrust
SplunkTrust

Some things to thing about.

[1] For RPM based systems, you can run your own scripted input that uses RPM's --qf option to provide a query format that includes the package name and the install time of the package. This could be useful data to you.

[2] This is a job that might require the maintenance of state. You were already thinking in this direction when you were thinking about trying to "set aside/collect yesterday's values". A good way of doing this in Splunk is with a lookup file. @araitz covers this in good detail in a blog post http://blogs.splunk.com/2011/01/11/maintaining-state-of-the-union/

These two things might be usable in combination or independently. I think I would probably start with the RPM queryformat and see if I could use that alone to see packages installed 'recently' by install timestamp. This gets more complicated when dealing with updates to existing packages, because you'd need some kind of false-positive discrimination...

lguinn2
Legend

Can we see a sample of the actual events for sourcetype=package?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...