Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #13054] API filters with custom attributes problem #4766

Closed
icinga-migration opened this issue Nov 5, 2016 · 3 comments
Closed
Labels
area/api REST API bug Something isn't working

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13054

Created by moritz on 2016-11-05 15:25:25 +00:00

Assignee: (none)
Status: New (closed on 2016-11-07 07:13:50 +00:00)
Target Version: (none)
Last Update: 2016-11-25 14:28:22 +00:00 (in Redmine)

Icinga Version: 2.3.4
Backport?: Not yet backported
Include in Changelog: 1

Some of our hosts have custom variables that are arrays, and I've tried to create a downtime for a all hosts that have a particular string as element in such a variable. There doesn't seem to be a way to do that, and if there is, then that documentation at http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/icinga2-api fails to mention it.

Things I have tried:

  • filter="thestring" in host.vars.thevariable, inspired by the example filter="linux-servers" in host.groups in the API docs. Result: no downtime created.
  • filter=match("thestring",host.vars.thevariable). Result: No downtime created
  • filter=match("*thestring*",host.vars.thevariable). Result: Hosts where host.vars.thevariable contain "thestringbutlonger" also get the downtime created.
@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-11-07 07:13:50 +00:00

  • Status changed from New to Rejected

The 'in' operator can be used to check whether a certain item is contained within an array.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-11-25 14:28:23 +00:00

  • Subject changed from The API doesn't seem to allow filtering by element membership in a list to API filters with custom attributes problem
  • Status changed from Rejected to New

@icinga-migration icinga-migration added bug Something isn't working area/api REST API labels Jan 17, 2017
@dnsmichi
Copy link
Contributor

The match() functionality for arrays has been added in 2.7.0 ( #5264 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants