Skip to content

how to query PSfalcon to avoid returning duplicate hosts #78

Answered by bk-cs
cesaramerico asked this question in Q&A
Discussion options

You must be logged in to vote

Are you trying to remove duplicates, or return results that don't have duplicates (by hostname)?

The problem you're facing is that Falcon thinks these are unique--because devices are linked to their agent ID value--and there's no filter that can exclude them as it would require some evaluation logic by the API (which it doesn't do).

So, with that in mind, you can either use Find-FalconDuplicate and Invoke-FalconHostAction to remove the duplicates so they're not in your results:

$Duplicates = Find-FalconDuplicate
Invoke-FalconHostAction -Name hide_host -Ids $Duplicates.device_id

Or retrieve all results and filter them based on unique Hostname values:

$NoDupes = Get-FalconHost -Detailed -A…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@walchst
Comment options

Answer selected by bk-cs
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants