rsyslog config conditions filtering ":programname,startswith"
# grep conditions -A 9 /etc/rsyslog.d/dynamic_file.conf
# Add conditions; if match, rewrite it to /var/log/app/%programname%.log"
if $syslogfacility-text == 'local6' and $programname startswith 'test' then ?Dyn_File
& ~
if $programname == 'blue' then ?Dyn_File
& ~
# The closing & ~ are closing tags to stop processing of further rules.