Skip to content

How can one search hosts by tags? #989

Answered by jshcodes
budachst asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to do a wildcard search as follows:

from falconpy import hosts

hosts = Hosts(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)

search_string = "whatever"

result = hosts.query_devices_by_filter_scroll(filter=f"tags:*'*{search_string}*'")

You can also adjust this to perform an exact match:

result = hosts.query_devices_by_filter_scroll(filter=f"tags:['{search_string}']")

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jshcodes
Comment options

@budachst
Comment options

@budachst
Comment options

@jshcodes
Comment options

Answer selected by budachst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
API usage General API usage issues and questions hosts Hosts or Host Groups issues and questions
2 participants