You can do it already (I do), just by specifying the filter in the jail. 
If you don't specify the filter then the filter name must match the jail 
name, but there is no problem specifying the filter.

Nick

On 2016-12-16 11:01, Dominic Raferd wrote:
> 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

------------------------------------------------------------------------------
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

Reply via email to