Commit Graph

48 Commits (f04bae13667da0dd6f8edd4ec8e71c6327e653f9)

Author SHA1 Message Date
Hank Leininger 2deb1b71a1
Sanity-check print-all-* vs print-no-* options.
Also, fixed a trivial whitespace issue.
2014-03-14 02:10:00 -04:00
Hank Leininger d4fb48fd14
Add --print-no-{missed,ignored} and restore -all.
Realized --print-all-{missed,ignored} aren't meant to be simple on/off,
but are meant to enable printing all lines even when there are more
than 20.

This restores the behavior of --print-all-*, but preserves the
memory-savings when --print-all-* are not specified.

Also adds --print-no-{missed,ignored} which can be used to suppress
printing of a line type entirely.
2014-03-14 01:57:55 -04:00
Hank Leininger aa7af6f9c2
Only remember log lines we need to print later.
When testing proccessing a large logfile (430 MB, 2M lines) without
--print-all-missed or --print-all-ignored, fail2ban-regex consumes
just over 2 GB of RAM before completing.  Even though it does not need
to retain any of the missed or ignored log lines, it does anyway.

With this patch, memory use never grows beyond about 11 MB (unless
--print-all-* are enabled).
2014-03-13 23:18:08 -04:00
Hank Leininger 27dafea281
Fix the --print-all-{missed,ignored} options.
Previously, fail2ban-regex always printed both regardless of whether
those options were present or not.

This commit duplicates the patch I submitted at
https://sourceforge.net/p/fail2ban/patches/25/
2014-03-13 22:47:28 -04:00
Daniel Black fff996c8df ENH: fix fail2ban-regex output to generate a man page with copyright notices 2013-10-31 10:26:49 +11:00
Yaroslav Halchenko 8c4ca29577 BF: correct comparison while comparing for "too many lines" 2013-10-14 16:15:36 -04:00
Daniel Black 05b4d2ce5b BF: -D to deconflict with datedetector 2013-09-24 08:35:12 +10:00
Daniel Black 8109467459 BF: use string replace rather than re.sub 2013-09-22 15:49:30 +10:00
Daniel Black 4b5ecbccd1 ENH: debuggex URLs with fail2ban-regex 2013-09-22 13:20:17 +10:00
Steven Hiscocks 879c1a32f7 ENH: fail2ban-regex now uses iteraable for log file
Previosuly, the whole file was read in first
2013-07-27 11:36:01 +01:00
Steven Hiscocks af46cd0e4f ENH: fail2ban-regex now sorts date templates, similar to actual filters
Sort occurs every 10 lines, as to not overly effect performance
2013-07-27 11:34:10 +01:00
Steven Hiscocks c2bdfefb62 DOC: Comment to fail2ban-regex - flagging lines matched multiple regexs 2013-07-16 20:58:44 +01:00
Steven Hiscocks 1a2b6442a0 ENH+BF+TST: Filter now returns reference to failregex and ignoreregex
This avoids duplication of code across fail2ban-regex and samples test
cases. This also now more neatly resolves the issue of double counting
date templates matches in fail2ban-regex.
In addition, the samples test cases now also print a warning message
that not all regexs have samples for them, with future plan to change
this to an assertion.
2013-07-15 22:22:13 +01:00
Yaroslav Halchenko 5bd186b854 ENH(minor): fail2ban-regex comment line doesn't have to have a space after leading # 2013-07-15 13:52:42 -04:00
Steven Hiscocks 2c8747cc76 BF: fail2ban-regex date detector template hits count now correct
closes #295
2013-07-15 18:40:32 +01:00
Steven Hiscocks ec0680d73a BF: fail2ban-regex when using ignoreregex file with empty regex 2013-06-29 19:17:22 +01:00
Yaroslav Halchenko e91419d361 ENH: fail2ban-regex -- add specification of loglevels to enable 2013-06-13 23:19:28 -04:00
Yaroslav Halchenko ffe381d91c RF: reworked -regex cmdline tool to use optparse, some unification and enhancement of outputs 2013-06-13 23:19:28 -04:00
Yaroslav Halchenko ffbbb9f8a3 ENH: deleted trailing spaces in fail2ban- cmdline tools
Now it was already a mix, and Cyril is not working on this code any
longer so no need to maintain this convention.
2013-03-29 12:31:50 -04:00
Yaroslav Halchenko d561a4c2bb BF: do not rely on scripts being under /usr -- might differ eg on Fedora -- rely on import of common.version (Closes gh-112)
This is also not ideal, since if there happens to be some systemwide common.version -- we are doomed

but otherwise, we cannot keep extending comparison check to /bin, /sbin whatelse
2013-01-28 09:54:12 -05:00
Yaroslav Halchenko 05af52e833 ENH: fail2ban-regex -- __str__ for RegexStat + modeline 2012-12-24 11:05:44 -05:00
Yaroslav Halchenko 03b31398aa ENH: BF (forgotten import) for prev commit + removed duplicate Author, adjusted __ fields for that in fail2ban-* scripts 2012-11-09 08:58:19 -05:00
Yaroslav Halchenko 9e7a3b7a04 ENH: until we make it proper module -- adjust sys.path only if system-wide run 2012-11-09 08:57:33 -05:00
Yaroslav Halchenko 6b7544a63a BF: removed sneaked a commented out sys.path.insert 2012-07-31 21:45:03 -04:00
Yaroslav Halchenko b33ae8c194 Ask users to report bugs to github's issues 2012-07-19 14:51:46 -04:00
Yaroslav Halchenko 617094fad5 BF: fail2ban-regex -- adding forgotten char for -v 2012-02-18 20:12:23 -05:00
Yaroslav Halchenko 5891d2d218 ENH: fail2ban-regex -- quieter by default and added --verbose mode
now # of hits groupped into regexp listings since it makes little to no sense
to have it separate
2012-02-10 22:51:31 -05:00
Yaroslav Halchenko d2ffee0b2d ENH: minor, just pythonized some parts of fail2ban-regex summary 2012-02-10 22:19:44 -05:00
Leonardo Chiquitto a7d47e8b36 Update Free Software Foundation's address
The address has changed from "59 Temple Place, Suite 330, Boston,
MA  02111-1307  USA" to "51 Franklin Street, Fifth Floor, Boston,
MA  02110-1301, USA" some time ago.
2011-12-30 12:41:46 -05:00
Cyril Jaquier 402cdeab5e - Updated e-mail
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@672 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-03-05 23:18:06 +00:00
Cyril Jaquier 27b3ce2adc - Updated copyright.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@670 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-03-05 23:06:28 +00:00
Cyril Jaquier 174ce7027a - Fixed fail2ban-regex. It support "includes" in configuration files.
- Modified "includes" to be more generic. We will probably support URL in the future.
- Small refactoring.

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@656 a942ae1a-1317-0410-a47c-b1dcaea8d605
2008-03-04 00:17:56 +00:00
Cyril Jaquier ce6b8c959e - Removed Python 2.4. Minimum required version is now Python 2.3.
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@635 a942ae1a-1317-0410-a47c-b1dcaea8d605
2007-12-16 21:38:04 +00:00
Cyril Jaquier 66063d2731 - Added "full line failregex" patch. Thanks to Yaroslav Halchenko. It will be possible to create stronger failregex against log injection
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@621 a942ae1a-1317-0410-a47c-b1dcaea8d605
2007-09-12 21:38:51 +00:00
Cyril Jaquier ada2d7234e - Added "ignoreregex" support to fail2ban-regex
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_8@596 a942ae1a-1317-0410-a47c-b1dcaea8d605
2007-07-10 19:54:01 +00:00
Cyril Jaquier 55009342ef - Added more details in output
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@530 a942ae1a-1317-0410-a47c-b1dcaea8d605
2007-01-29 20:31:04 +00:00
Cyril Jaquier 7bcfd2ace9 - Added file support to fail2ban-regex. Benchmark feature has been removed
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@523 a942ae1a-1317-0410-a47c-b1dcaea8d605
2007-01-21 22:21:13 +00:00
Cyril Jaquier ab3d2d1b9a - Now Fail2ban goes in /usr/share/fail2ban instead of /usr/lib/fail2ban. This is more compliant with FHS. Thanks to Axel Thimm and Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@511 a942ae1a-1317-0410-a47c-b1dcaea8d605
2007-01-04 12:58:21 +00:00
Cyril Jaquier cd012dda85 - Added svn:keywords
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@504 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-12-23 16:37:17 +00:00
Cyril Jaquier 0f31cc0feb - Added support for several "failregex" and "ignoreregex". This should simplify the configuration files.
- Configuration files are backward-compatible but need to be updated in order to take advantage of this feature.

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@503 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-12-23 16:31:00 +00:00
Cyril Jaquier 58acd9fb9f - Moved version.py and protocol.py to common/
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@467 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-11-16 21:07:42 +00:00
Cyril Jaquier 519eddef21 - Added better debugging output
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@441 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-10-31 22:25:26 +00:00
Cyril Jaquier 040e47be5a - Added version and usage output
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@397 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-10-01 21:22:27 +00:00
Cyril Jaquier 9f5f6812f5 - Added a getTemplates() method because self.__templates can not be accessed directly anymore
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@371 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-09-19 22:21:20 +00:00
Cyril Jaquier 126807dea8 - Made private fields prefixed with "__"
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@368 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-09-19 20:38:32 +00:00
Cyril Jaquier 4eb611dd46 - Added date template hits summary
- Desactivated garbage collector while benchmarking

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@345 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-09-10 20:52:22 +00:00
Cyril Jaquier 6b1d9b6180 - Added benchmark
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@330 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-09-06 19:31:23 +00:00
Cyril Jaquier a998e54bb9 - Added "fail2ban-regex". This is a tool to help finding "failregex"
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@329 a942ae1a-1317-0410-a47c-b1dcaea8d605
2006-09-06 18:25:11 +00:00