API only returns 52 of 200 items

Hello,
I am building a small script to get all services part of a specific service group, I am able to pull only 52 of the 200 service objects associated with this service group. I have tried ading limit=200 but it still only pulls 52.

My question is, is there a default setting somewere that limits the api to 52 or am I doing something wrong with my scripts?

curl example
curl -k -s -u ‘icinga:password’ -H ‘Accept: application/json’ -H ‘X-HTTP-Method-Override: GET’ -X POST ‘https://localhost:5665/v1/objects/services’ -d ‘{ “filter”: " match(pattern,service.groups)", “filter_vars”: { “pattern”: “certificate_check” } }’

Requested system information

  • Version used (icinga2 --version)
    cinga2 - The Icinga 2 network monitoring daemon (version: 2.12.3)

  • Operating System and version
    System information:
    Platform: Red Hat Enterprise Linux Server
    Platform version: 7.9 (Maipo)
    Kernel: Linux
    Kernel version: 3.10.0-1127.13.1.el7.x86_64
    Architecture: x86_64

  • Enabled features (icinga2 feature list)
    Enabled features: api checker command ido-mysql mainlog notification

  • Icinga Web 2 version and modules (System - About)

  • Config validation (icinga2 daemon -C)
    [2021-06-02 11:10:10 -0500] information/cli: Icinga application loader (version: 2.12.3)
    [2021-06-02 11:10:10 -0500] information/cli: Loading configuration file(s).
    [2021-06-02 11:10:10 -0500] information/ConfigItem: Committing config item(s).
    [2021-06-02 11:10:10 -0500] warning/ApiListener: Attribute ‘key_path’ for object ‘api’ of type ‘ApiListener’ is deprecated and should not be used.
    [2021-06-02 11:10:10 -0500] warning/ApiListener: Attribute ‘ca_path’ for object ‘api’ of type ‘ApiListener’ is deprecated and should not be used.
    [2021-06-02 11:10:10 -0500] warning/ApiListener: Attribute ‘cert_path’ for object ‘api’ of type ‘ApiListener’ is deprecated and should not be used.

[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 NotificationComponent.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 793 Hosts.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 18 Downtimes.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 9 NotificationCommands.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 FileLogger.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 31 Comments.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 8851 Notifications.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 IcingaApplication.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 208 HostGroups.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 4706 Dependencies.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 CheckerComponent.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 3 Zones.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 Endpoint.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 6 ApiUsers.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 1 ApiListener.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 262 CheckCommands.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 6 TimePeriods.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 4 UserGroups.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 23 Users.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 4306 Services.
[2021-06-02 11:10:14 -0500] information/ConfigItem: Instantiated 28 ServiceGroups.
[2021-06-02 11:10:14 -0500] information/ScriptGlobal: Dumping variables to file ‘/var/cache/icinga2/icinga2.vars’
[2021-06-02 11:10:14 -0500] information/cli: Finished validating the configuration file(s).

In case someone else finds themselves in a similar issue, I am providing an update on what I found.

Narrowed it down. The objects that are showing have only one service group, so the issue is that I am not able to pull a service object that has multiple service groups assigned to it. I thought the match function would match any variable in the service groups array, though it appears to only match if it is the only variable in the array. Now to dig through the api docs and find the correct function, or limit service groups to only one…

https://icinga.com/docs/icinga-2/latest/doc/18-library-reference/#match

You need to add MatchAny as third parameter of the match function, so it matches if is in the group and others, not only if this is the only group.

The other option would be to use "pattern" in service.groups which searches pattern in an array, but only works if pattern is a string.