what version of bsa?
i think you can do a 'if exists' loop but i forget what that's in the discovery signatures.
We are currently running 8.3. All "loop" operations (foeach loop / count loop / exists loop) are greyed out and I remember having read that when defining a signature only basic conditions and If braches are available.
I already tried a lot of combinations with and without "exists", yet it only worked when I specifically tested for a configuration file entry before testing via wildcard e.g:
Removing the first condition it immediatly falls back to the previous behaviour: