Splunk Search

How to search if Windows update was installed successfully or not on multiple servers?

idab
Path Finder

Hi guys,

I modified a search we found online to show us what updates were installed successfully or not. The problem is, it says a fail on Splunk, but when we check the servers and WSUS, it says the updates were successfully installed. What would be the best way to write the search to check if the it was a good or failed installation?

Here is the search :

sourcetype=WinEventLog:System EventCode=19  tag=update | eval Date=strftime(_time, "%Y/%m/%d") | rex "\WKB(?<KB>.\d+)\W" | eval successRatio = if (status==installed, "GOOD" , "FAILED") | stats count by Date , host, package_title, KB , body , successRatio| sort host

Looking forward to ideas or response on this.

Thanks guys.

0 Karma

somesoni2
Revered Legend

If you see the field "Keywords" in your logs, try something like this

index=main sourcetype=WinEventLog:System EventCode=19  | eval Date=strftime(_time, "%Y/%m/%d") | rex "\WKB(?<KB>.\d+)\W" | eval successRatio=mvindex(split(Keywords,","),-1) | stats count by Date , host, package_title, KB , body , successRatio| sort host

idab
Path Finder

Thanks for the feedback somesoni2,
This was nicely done ; but i noticed the keywords on my log shows only what was installed and not the failed updates.
Any idea on how to find or get the information regarding the updates that failed during installation on the host ? If only there was way to recreate the above search to check for unsuccessful updates?

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...