Provision Tag for Status

Hi,
I would like to write a scrip that set up a Tag when at least one o my IPv4Forwarding Status is not “Enabled”. The number should be variable

Device.Routing.Router.1.IPv4Forwarding.*.Status

I tried using a “For” but if I do not have a number (For example number 1 - Device.Routing.Router.1.IPv4Forwarding.1.Status)

Script stop with an error.

Some idea??

Thanks
Simone