This code is not special to AIX at all, it will be pretty much identical for all UNIX types.
For an input like
[monitor:///inputs/*/1/2/36/file[0-9]{3}.log]
We have to set up a watch on /inputs, because everything beyond this point is a pattern match.
We do use pcre partial-match testing, so that if we reach a directory that PCRE can tell us will never match, no matter how much additional text is added, we can skip it.
Thus, for example if we find a dir such as
/inputs/q/2
we should be able to skip over this, because no matter how much additional text is added, the 2 will never match the 1 in the regex.
However, I'm a little unclear about the case of
/inputs/q/1/2/3
I think we try to force this to fail to match here by adding a slash after the directory name, but I'm not certain. We might descend into this directory. I would recommend testing locally in a simple setup.
Yann's answer to specify only the exact dirs you want observed will certainly work.
As for your attempted workaround, I think it's a little sketchy to ask Splunk to monitor /. However your regex which gets built out as ^/input[^/]*/[a-zA-Z0-9/]+file[0-9]+.log$ is very permissive. It allows any sequence of dir names that contain only ascii alphanumerics, followed a numbered filename. This regex should allow tailing to look at every single file in the hierarchy.
... View more