I’m trying to write a query, using a filter, but I can’t seem to get it right. I am able to list all the services using the API on all hosts but not able to list any specific services.I want to find just the ones that match for example ‘check_disk’( which run’s on all nodes and filebeat service which runs on only specific nodes I tried with the below command but didn’t helped and have tried searching, but I don’t seem to find the docs I need.
The below command gives me a 200 but no results.
curl -k -s -u root:a58ad06f650b97a9 -H ‘Accept: application/json’ -H ‘X-HTTP-Method-Override: GET’ -X POST ‘https://localhost:5665/v1/objects/services’ -d ‘{ “filter”: “service.state==state && match(pattern,service.name)”, “filter_vars”: { “state”: 2, “pattern”: “*check_dns” } }’
{“results”:[]}