Forgive me if I ask something that is too obvious. I have tried searching, but I don’t seem to find the docs I need. I’m trying to write a specific query, using a filter, but I can’t seem to get it right. This is what I want to achieve - I have a the same check, check_fs, running on a number of systems, and I want to get a list of the ones that are critical. I know how to find all services that are critical, but I want to find just the ones that match ‘check_fs’. I tried with:
curl -k -s -u mickey:mouse 'https://zenoss.hpc.ic.ac.uk:5665/v1/objects/services?filter=service.state==2&filter=match("*!check_fs",service.name)' <h1>Bad Request</h1><p><pre>Invalid URL Query</pre></p>
And in fact, when I try the example in https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#filters:
curl -k -s -u toot:TheresATrainsaComin 'https://zenoss.hpc.ic.ac.uk:5665/v1/objects/hosts?filter=match("cx1-100*",host.name)' <h1>Bad Request</h1><p><pre>Invalid URL Query</pre></p>
Clearly, I’m not getting it right. Where do I get it wrong? And leading on from that, is there a document, page, tutorial that explains filters and joins in more detail?