Question about filters and regex

Hi

I need to use a specific call to retrieve some objects on API with curl command, and on my filter I need to specify 2 conditions or more…

My request is:

curl -k -s -u admin:XXXXXXX -H 'Accept: application/json' -H 'X-HTTP-Method-Override: GET' -X POST 'https://api.XXXXXXXX.YYYY:5665/v1/objects/hosts'  -d '{ "filter": "match(\"*hostname1\" && \"*hostname2\", host.name)", "pretty": true, "attrs": [ "name"]}' | jq '{name: .results[].name}' | grep name

With this request I can only retrieve hosts matching hostname2
If I’m using || instead of &&, I can only retrieve hosts matching hostname1

Do you have any ideas?
Thanks

Alex

You need to chain two match calls (one per pattern) with || or && at your option.