XQL query display hosts with KB not installed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

XQL query display hosts with KB not installed

L3 Networker

Hi,

If I want to display hosts with some KBs installed, it is relatively easy as I use following query:

preset = host_inventory_kbs
| filter endpoint_type contains "WORKSTATION" and hotfix_id in ("KB5034763","KB5034122")
| fields  endpoint_name

Problem starts when I want to display hosts without any of KBs installed as with operator NOT IN, results shows all other patches not hosts without them. Could somebody advise how to create it correctly please? 

4 REPLIES 4

L2 Linker

Try this using one KB value at a time.

 

preset = host_inventory_kbs
| filter endpoint_type contains "WORKSTATION"
| filter hotfix_id != null
| filter hotfix_id not contains "KB5034763"
| fields endpoint_name, hotfix_id

Thanks for your reply.

 

Unfortunately this query doesn't do what I was looking for. The result displays all patches which are not "KB5034763" and on which host they are installed so around 12,000 items with 800 hosts. I'm looking to display hosts which don't have this patch installed, the results should be less then total number of hosts.

Try this maybe?  It removes the hotfix ID and uses dedup to limit the list to single entries for hosts:
preset = host_inventory_kbs
| filter endpoint_type contains "WORKSTATION"
| filter hotfix_id != null
| filter hotfix_id not contains "KB5034763"
| fields endpoint_name
| dedup endpoint_name

Hi,

 

Thank you for the reply.

 

Sadly the query doesn't work. If the KB5034763 would be the only update on computer it would give proper results but as it is not, it shows all other updates and as a result after deduplication, returns all computers.

  • 766 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!