Migrate monitoring/filter/objects to icingadb/filter/objects

Hi all,
installed IcingaDB today and currently trying to migrate all Icinaweb2 settings to Icingadbweb.
I am struggling with the icingadb/​filter/​objects.
In my Icinga config, I am using a host/service array for the teams, which should have access to it in icingaweb2, e.g.

template Host "TeamA" {
  vars.icingaweb += [ "TeamA" ]
}

or

object Host "bla" {
[...]
vars.icingaweb += [ "TeamB", "TeamC" ]
vars.http["blubb"] = {
  [...]
  icingaweb += [ "TeamD" ]
  }
}

The filter, which works for the team roles in the monitoring module is, e.g. for TeamA:
monitoring/​filter/​objects: _host_icingaweb=*\"TeamA\"*|_service_icingaweb=*\"TeamA\"*
same for TeamB and so on.
I tried to convert it to the new name scheme in icingawebdb:
icingadb/​filter/​objects: host.vars.icingaweb=*\"TeamA\"*|service.vars.icingaweb=*\"TeamA\"*

Tried several filter so far, but nothing is working. Can anybody give me a hint, how to migrate this?

Cheers,
Marcus

That’s an array, so you need to access its entries by index. How to do that is covered in the documentation.

I had read the docs, but couldn’t get it working. Seems the quotations marks in my filter broke my neck.
With
host.vars.icingaweb[*]=TeamA|service.vars.icingaweb[*]=TeamA
it is working.
So one more question: In the past, I had to use the quotation marks, to filter the view for “Sub-Teams”(see Question to filter monitoring object). This is not necessary anymore?

No, the custom variables are now flattened in the database available. That’s what is used if you use the host.vars. or service.vars. relation.

What you’ve used previously was matching the JSON structure. This noise is now not there anymore, so there’s no need for quotation marks or other special characters.

Alright, nice! Thanks for the clarification.