In a filter's failregex, can we have a variable equal to or containing the name of the jail using it? So that two jails can use the same filter and the failregex will match different messages depending on the jail?
Use case: I'm using fail2ban v0.9.3. I have created two jails 'relay-long' and 'relay-short', and they are both monitoring the same log file (syslog) and waiting for messages containing tag 'relay-long' or 'relay-short' and then some other text (which is the same for both jails). As the names suggest, one imposes a shorter bantime and the other a longer. I have this working with each jail having its own filter. Each filter has an identical failregex which contains variable __prefix_line. The only difference between the filters is variable _daemon which is hard-coded to the name of the jail that uses the filter. (The default definition of __prefix_line, which I haven't changed, contains _daemon.) It seems like I am using two filters where it would be more elegant to use one, but I can't find how to achieve this. Any help gratefully received. Dominic ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Fail2ban-users mailing list Fail2ban-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fail2ban-users