{"id":901,"date":"2013-09-06T15:27:26","date_gmt":"2013-09-06T15:27:26","guid":{"rendered":"http:\/\/www.nooblet.org\/blog\/?p=901"},"modified":"2013-09-07T10:44:43","modified_gmt":"2013-09-07T10:44:43","slug":"logcheck-various-filters","status":"publish","type":"post","link":"https:\/\/www.nooblet.org\/blog\/2013\/logcheck-various-filters\/","title":{"rendered":"logcheck &#8212; various filters"},"content":{"rendered":"<p>As <a href=\"\/blog\/2013\/logcheck-amavisd-new-filter\/\">mentioned earlier<\/a>, I have a few of these logcheck filters I have created over the past few years. I use Debian and CentOS so other distros may not perfectly match.<\/p>\n<p>These work in conjunction with the default filters, hence their naming scheme of local_&lt;service&gt;.<\/p>\n<p><strong>Dovecot<\/strong><br \/>\nlogin, logout, mysql connections, lda delivery, ssl regen <\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_dovecot\" >^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ dovecot: (pop3|imap)-login: Login: user=&lt;[-_.@[:alnum:]]+&gt;, method=[[:alnum:]-]+, rip=[.:[:alnum:]\\s]+, lip=[.:[:alnum:]\\s]+(, mpid=[[:digit:]]+)?(, (TLS( handshake)?|secured))?$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ dovecot: (pop3|imap)(-login)?(\\([-_.@[:alnum:]]+\\))?: (Connection closed|Disconnected( for inactivity|: (Logged out|Disconnected in IDLE))) bytes=[[:digit:]]+\\\/[[:digit:]]+$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ (dovecot: )?((deliver|lda)\\([-_.@[:alnum:]]+\\)|lda\\([-_.@\\w]+\\)): sieve: msgid=&lt;?[^\\(]*&gt;?( \\(((added by )?[^[:space:]]+|sfid-[_[:xdigit:]]+)\\)?)?[[:space:]]*: (stored mail into mailbox '.*'|marked message to be discarded if not explicitly delivered \\(discard action\\)|(forwarded to|sent vacation response to|discarding vacation response for message implicitly delivered to|not sending vacation response to system address|discarding vacation response to mailinglist recipient|discarded vacation reply to|discarding vacation response to (auto-submitted|precedence=bulk) message from|discarded duplicate (vacation response|forward) to) &lt;[^[:space:]]*&gt;)$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ dovecot: (pop3|imap)-login: Disconnected \\(no auth attempts\\): rip=[.[:digit:]]+, lip=[.[:digit:]]+(, (TLS|SSL|secured))?.*$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ dovecot: auth: mysql: Connected to [._[:alnum:]-]+ \\(postfix\\)$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ dovecot: ssl-params: (Generating )?SSL parameters( regeneration completed)?$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"wp-downloadmanager-sprite\" aria-hidden=\"true\" focusable=\"false\"><symbol id=\"wp-downloadmanager-icon-file\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-archive\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M11 3h2v2h-2zM11 6h2v2h-2zM11 9h2v2h-2zM10.5 13h3v3.5h-3z\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-audio\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M10 18.5v-5l5-1.5v5\" \/><circle cx=\"9\" cy=\"18.5\" r=\"1.4\" \/><circle cx=\"14\" cy=\"17\" r=\"1.4\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-code\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M10.5 12.5 8 15.5l2.5 3M13.5 12.5 16 15.5l-2.5 3\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-document\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M9 12.5h6M9 15.5h6M9 18.5h4\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-image\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><circle cx=\"10\" cy=\"13.5\" r=\"1.1\" \/><path d=\"M8 19.5l3-3 2 2 3-3.5 2 4.5z\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-presentation\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M9 19.5v-3M12 19.5v-5.5M15 19.5v-8\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-spreadsheet\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M8 12.5h8v7H8zM8 16h8M11.5 12.5v7\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-video\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><path d=\"M10.5 13.5l5 3-5 3z\" \/><\/symbol><symbol id=\"wp-downloadmanager-icon-application\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M6 2.5h7l5 5v14H6z\" \/><path d=\"M13 2.5v5h5\" \/><circle cx=\"12\" cy=\"16.5\" r=\"2\" \/><path d=\"M12 12.5V14M12 19v1.5M8.5 16.5H10M14 16.5h1.5\" \/><\/symbol><\/svg><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_dovecot\">local_dovecot<\/a><\/strong> (1.5 KiB, 2,556 hits)<br><\/div><br \/>\n<strong>Managesieve<\/strong> (part of Dovecot)<br \/>\nlogin, logout<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_managesieve\" >^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ managesieve-login: Login: user=<[_@\\.[:alnum:]-]+>, method=[[:alnum:]]+, rip=[[:digit:]\\.]+, lip=[[:digit:]\\.]+(, mpid=[[:digit:]\\.]+)?(, TLS)?$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ managesieve\\([_@\\.[:alnum:]-]+\\): Disconnected: Logged out bytes=[[:digit:]]+\\\/[[:digit:]]+$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_managesieve\">local_managesieve<\/a><\/strong> (320 bytes, 2,504 hits)<br><\/div><br \/>\n<strong>OpenVPN<\/strong><br \/>\nlogin related<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_openvpn\" >^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ (openvpn|ovpn-[._[:alnum:]-]+)\\[[[:digit:]]+\\]: TCP connection established with (\\[AF_INET\\])?[.[:digit:]]{7,15}:[[:digit:]]{2,5}$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ (openvpn|ovpn-[._[:alnum:]-]+)\\[[[:digit:]]+\\]: (Local|Expected Remote) Options String: '[., _[:alnum:]-]+'$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ (openvpn|ovpn-[._[:alnum:]-]+)\\[[[:digit:]]+\\]: TCPv4_SERVER link (local \\(bound\\)|remote): (\\[AF_INET\\])?[.[:digit:]]{7,15}:[[:digit:]]{2,5}$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_openvpn\">local_openvpn<\/a><\/strong> (506 bytes, 2,511 hits)<br><\/div><br \/>\n<strong>PostFWD<\/strong><br \/>\nstatistic log lines: dnsbl, rules, stats, cache, rate<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_postfwd\" >^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ postfwd\\[[[:digit:]]+\\]: \\[(DNSBL|RULES|STATS|CACHE|RATE)\\].*$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_postfwd\">local_postfwd<\/a><\/strong> (104 bytes, 2,573 hits)<br><\/div><br \/>\n<strong>ProFTPd mod_ban<\/strong> (<a href=\"http:\/\/www.proftpd.org\/docs\/contrib\/mod_ban.html\" target=\"_blank\">optional module<\/a>)<br \/>\nobtained, detached, removed, showing ban list<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_proftpd-banlog\" >^\\w{3} [ :[:digit:]]{11} mod_ban\\\/[[:digit:]\\.]+\\[[[:digit:]]+\\]: (obtained|detached|removed) shmid [[:digit:]]+ for BanTable '[\/[:alpha:]\\.]+'$\r\n^\\w{3} [ :[:digit:]]{11} mod_ban\\\/[[:digit:]\\.]+\\[[[:digit:]]+\\]: showing ban lists$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_proftpd-banlog\">local_proftpd-banlog<\/a><\/strong> (230 bytes, 2,352 hits)<br><\/div><br \/>\n<strong>rSYSlog<\/strong><br \/>\nstart, exit, reload\/hup, mark<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_rsyslog\" >^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ kernel: imklog [0-9.]+, log source = \/proc\/kmsg started.$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ kernel: Kernel logging \\(proc\\) stopped.$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: -- MARK --$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ cronmark: -- MARK --$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \\[origin software=\"rsyslogd\" swVersion=\"[0-9.]+\" x-pid=\"[0-9]+\" x-info=\"http:\/\/www.rsyslog.com\"\\] start$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \\[origin software=\"rsyslogd\" swVersion=\"[0-9.]+\" x-pid=\"[0-9]+\" x-info=\"http:\/\/www.rsyslog.com\"\\] exiting on signal [0-9]+.$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \\[origin software=\"rsyslogd\" swVersion=\"[0-9.]+\" x-pid=\"[0-9]+\" x-info=\"http:\/\/www.rsyslog.com\"\\] rsyslogd was HUPed$\r\n^\\w{3} [ :0-9]{11} [._[:alnum:]-]+ rsyslogd: \\[origin software=\"rsyslogd\" swVersion=\"[0-9.]+\" x-pid=\"[0-9]+\" x-info=\"http:\/\/www.rsyslog.com\"\\] rsyslogd was HUPed(, type 'lightweight'.)?$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_rsyslog\">local_rsyslog<\/a><\/strong> (954 bytes, 2,502 hits)<br><\/div><br \/>\n<strong>OpenSSH<\/strong><br \/>\nclosed user request, closed preauth 127.0.0.1<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_ssh\" >^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\\[[[:digit:]]+\\]: Received disconnect from [[:digit:]\\.]+: [[:digit:]]+: Closed due to user request\\.$\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\\[[[:digit:]]+\\]: Connection closed by 127.0.0.1 \\[preauth\\]$<\/pre>\n<p><div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_ssh\">local_ssh<\/a><\/strong> (255 bytes, 2,521 hits)<br><\/div><br \/>\n<strong>swapspace<\/strong><br \/>\nallocating, retiring, adding (kernel)<\/p>\n<pre class=\"expand:true lang:default decode:true \" title=\"local_swapspace\" >^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ \/usr\/sbin\/swapspace: Allocating swapfile '[0-9]+'\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ \/usr\/sbin\/swapspace: Retiring swapfile '[0-9]+'\r\n^\\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ kernel: \\[[0-9\\.]+\\] Adding [0-9]+k swap on [0-9]+.  Priority:-[0-9]+ extents:[0-9]+ across:[0-9]+k SS<\/pre>\n<div class=\"wp-downloadmanager\"><svg class=\"wp-downloadmanager-icon\" aria-hidden=\"true\" focusable=\"false\"><use href=\"#wp-downloadmanager-icon-file\" \/><\/svg>&nbsp;&nbsp;<strong><a href=\"https:\/\/www.nooblet.org\/blog\/download\/local_swapspace\">local_swapspace<\/a><\/strong> (324 bytes, 2,490 hits)<br><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As mentioned earlier, I have a few of these logcheck filters I have created over the past few years. I use Debian and CentOS so other distros may not perfectly match. These work in conjunction with the default filters, hence their naming scheme of local_&lt;service&gt;. Dovecot login, logout, mysql connections, lda delivery, ssl regen ^\\w{3} [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[198,233,194],"class_list":["post-901","post","type-post","status-publish","format-standard","hentry","category-linux","tag-filters","tag-linux","tag-logcheck"],"_links":{"self":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/comments?post=901"}],"version-history":[{"count":35,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/901\/revisions"}],"predecessor-version":[{"id":940,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/901\/revisions\/940"}],"wp:attachment":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media?parent=901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/categories?post=901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/tags?post=901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}