Thanks for the reply, but writing a function (I took a look at DSL: Flatten a nested dictionary with a function for apply for rules) would complicate things rather than making it easier.
Unless you have a straightforward example of such a function at hand?
Oh and I can’t use “if” inside the apply
rule because it is managed by puppet-icinga2.