Title
#fleet
w

wennan.he

10/27/2022, 6:28 PM
Hi Fleet team, i am trying to run some APIs and filtering them by given ip, but the return list seems not expected, is there sth wrong and how to filter hosts by ip list?
Kathy Satterlee

Kathy Satterlee

10/27/2022, 6:35 PM
The
ipv4
filter is not available in the
counts
endpoint. You can see the full list of available parameters here: https://fleetdm.com/docs/using-fleet/rest-api#parameters25
w

wennan.he

10/27/2022, 6:38 PM
is there anyway by fleet api, fleetctl or osqueryi to query all the host by given ip lists?
Kathy Satterlee

Kathy Satterlee

10/27/2022, 7:06 PM
My original advice for that would still be what I would recommend: https://osquery.slack.com/archives/C01DXJL16D8/p1666301340994349?thread_ts=1666296889.627119&cid=C01DXJL16D8 I understand you've run into some oddness with the ip addresses, have you had a chance to run the query @roberto sent over to verify if the upcoming fix will do the trick for you?: https://osquery.slack.com/archives/C01DXJL16D8/p1666627014936249?thread_ts=1666304888.397699&cid=C01DXJL16D8
7:12 PM
Just for clarity, while
ipv4
can't be used as a filter for
/hosts/count
, it can be used with
/hosts
7:52 PM
And to add some context, this is essentially what is happening behind the scenes when you use the target picker in the Fleet UI.