Regular Expressions 101

Save & Share

  • Regex Version: ver. 2
  • Update Regex
    ctrl+⇧+s
  • Save new Regex
    ctrl+s
  • Add to Community Library

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
gm

Test String

Code Generator

Generated Code

# coding=utf8 # the above tag defines encoding for this document and is for Python 2.x compatibility import re regex = r"(?J)^[^f]+ (?<vendor_product>[^\.]+).(?<vendor_module>[^\s]+)\s+\[(?<pid>[\d]+)]:\s(?<vendor_level>[\w]+)\s+(\[(?<jail>[^\]]+)]\s)?(?<vendor_message>(?<vendor_action>Found|Ban|Unban|Restore Ban)?\s?(?<src>(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\s?(?<vendor_action>already banned|is not banned| - ((?<initial_date>.*))?)?|.*)$" test_str = ("2019-03-06 15:42:12,690 fail2ban.actions [7667]: NOTICE [sshd] Ban 79.36.200.216\n" "2019-03-06 15:42:12,860 fail2ban.filter [7667]: INFO [sshd] Found 200.105.205.186\n" "2019-03-06 15:42:12,902 fail2ban.filter [7667]: INFO [sshd] Found 200.105.205.186\n" "2019-03-06 15:42:14,711 fail2ban.filter [7667]: INFO [sshd] Found 200.105.205.186\n" "2019-03-06 15:42:14,913 fail2ban.actions [7667]: NOTICE [sshd] Ban 200.105.205.186\n" "2019-03-06 15:44:50,977 fail2ban.actions [7667]: NOTICE [sshd] Unban 157.230.142.190\n" "2019-03-06 15:46:55,215 fail2ban.filter [7667]: INFO [sshd] Found 118.89.52.205\n" "2019-03-06 15:46:55,246 fail2ban.filter [7667]: INFO [sshd] Found 118.89.52.205\n" "2019-03-06 15:46:57,272 fail2ban.filter [7667]: INFO [sshd] Found 118.89.52.205\n" "2019-03-06 15:46:57,665 fail2ban.actions [7667]: NOTICE [sshd] Ban 118.89.52.205\n" "2019-03-06 14:25:05,648 fail2ban.filter [7667]: INFO [wordpress-soft] Found 185.86.164.102\n" "2019-03-06 09:01:10,389 fail2ban.filter [7667]: INFO Log rotation detected for /var/log/nginx/wordpress-error.log\n" "2019-03-03 10:18:04,140 fail2ban.actions [13354]: NOTICE [sshd] 82.212.157.213 already banned\n" "019-02-24 06:25:05,136 fail2ban.server [18645]: INFO rollover performed on /var/log/fail2ban.log\n" "2019-02-24 06:25:10,970 fail2ban.filter [18645]: INFO Log rotation detected for /var/log/auth.log\n" "2019-02-24 06:25:10,974 fail2ban.filter [18645]: INFO Log rotation detected for /var/log/auth.log\n" "2019-03-01 12:12:14,149 fail2ban.jail [6735]: INFO Creating new jail 'vsftpd'\n" "2019-03-01 12:12:14,149 fail2ban.jail [6735]: INFO Jail 'vsftpd' uses pyinotify {}\n" "2019-03-01 12:12:14,161 fail2ban.jail [6735]: INFO Initiated 'pyinotify' backend\n" "2019-03-01 12:12:14,163 fail2ban.filter [6735]: INFO Set findtime = 3600\n" "2019-03-01 12:12:14,164 fail2ban.actions [6735]: INFO Set banTime = 604800\n" "2019-03-01 12:12:14,165 fail2ban.filter [6735]: INFO Set jail log file encoding to UTF-8\n" "2019-03-01 12:12:14,166 fail2ban.filter [6735]: INFO Set maxRetry = 3\n" "2019-03-01 12:12:14,167 fail2ban.filter [6735]: INFO Added logfile = /var/log/vsftpd.log\n" "2019-03-01 12:12:14,194 fail2ban.jail [6735]: INFO Creating new jail 'wordpress-hard'\n" "2019-03-01 12:12:14,195 fail2ban.jail [6735]: INFO Jail 'wordpress-hard' uses pyinotify {}\n" "2019-03-01 12:12:14,208 fail2ban.jail [6735]: INFO Initiated 'pyinotify' backend\n" "2019-03-01 12:12:14,210 fail2ban.filter [6735]: INFO Set findtime = 3600\n" "2019-03-01 12:12:14,210 fail2ban.actions [6735]: INFO Set banTime = 604800\n" "2019-03-01 12:12:14,211 fail2ban.filter [6735]: INFO Set jail log file encoding to UTF-8\n" "2019-03-01 12:12:14,213 fail2ban.filter [6735]: INFO Set maxRetry = 1\n" "2019-03-01 12:12:14,214 fail2ban.filter [6735]: INFO Added logfile = /var/log/auth.log\n" "2019-03-06 13:44:51,389 fail2ban.utils [3908]: ERROR 7fef0428e938 -- returned 1\n" "2019-03-06 13:44:51,390 fail2ban.actions [3908]: ERROR Failed to execute unban jail 'sshd' action 'iptables-multiport' info 'ActionInfo({'ip': '176.31.69.109', 'family': 'inet4', 'ip-rev': '109.69.31.176.', 'ip-host': 'dc109.1fo.fr', 'fid': '176.31.69.109', 'failures': 3, 'time': 1551811401.8170147, 'matches': 'Mar 5 13:44:49 gld-c2-deb-6 sshd[6725]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=176.31.69.109 \\nMar 5 13:44:51 gld-c2-deb-6 sshd[6725]: Failed password for invalid user test2 from 176.31.69.109 port 40632 ssh2', 'restored': 1, 'F-*': {'matches': ['Mar 5 13:44:49 gld-c2-deb-6 sshd[6725]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=176.31.69.109 ', 'Mar 5 13:44:51 gld-c2-deb-6 sshd[6725]: Failed password for invalid user test2 from 176.31.69.109 port 40632 ssh2'], 'failures': 3, 'mlfid': ' gld-c2-deb-6 sshd[6725]: ', 'user': 'test2', 'ip4': '176.31.69.109'}, 'ipmatches': 'Mar 3 21:41:53 gld-c2-deb-6 sshd[2885]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=176.31.69.109 \\nMar 3 21:41:55 gld-c2-deb-6 sshd[2885]: Failed password for invalid user d2ph from 176.31.69.109 port 37684 ssh2\\nMar 5 13:44:49 gld-c2-deb-6 sshd[6725]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=176.31.69.109 \\nMar 5 13:44:51 gld-c2-deb-6 sshd[6725]: Failed password for invalid user test2 from 176.31.69.109 port 40632 ssh2', 'ipjailmatches': 'Mar 3 21:41:53 gld-c2-deb-6 sshd[2885]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=176.31.69.109 \\nMar 3 21:41:55 gld-c2-deb-6 sshd[2885]: Failed password for invalid user d2ph from 176.31.69.109 port 37684 ssh2\\nMar 5 13:44:49 gld-c2-deb-6 sshd[6725]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=176.31.69.109 \\nMar 5 13:44:51 gld-c2-deb-6 sshd[6725]: Failed password for invalid user test2 from 176.31.69.109 port 40632 ssh2', 'ipfailures': 6, 'ipjailfailures': 6})': Error unbanning 176.31.69.109\n" "2019-03-06 13:45:34,387 fail2ban.actions [3908]: NOTICE [sshd] Unban 180.151.3.103\n" "2019-03-06 13:45:34,578 fail2ban.utils [3908]: Level 39 7fef0428e8b0 -- exec: iptables -w -D f2b-sshd -s 180.151.3.103 -j REJECT --reject-with icmp-port-unreachable\n" "2019-03-06 13:45:34,579 fail2ban.utils [3908]: ERROR 7fef0428e8b0 -- stderr: 'iptables: Bad rule (does a matching rule exist in that chain?).'\n" "2019-03-06 13:45:34,579 fail2ban.utils [3908]: ERROR 7fef0428e8b0 -- returned 1\n" "2019-03-06 13:45:34,579 fail2ban.actions [3908]: ERROR Failed to execute unban jail 'sshd' action 'iptables-multiport' info 'ActionInfo({'ip': '180.151.3.103', 'family': 'inet4', 'ip-rev': '103.3.151.180.', 'ip-host': 'kbase.velocis.info', 'fid': '180.151.3.103', 'failures': 3, 'time': 1551811401.8183885, 'matches': 'Mar 5 13:45:32 gld-c2-deb-6 sshd[6762]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=180.151.3.103 \\nMar 5 13:45:34 gld-c2-deb-6 sshd[6762]: Failed password for invalid user qa from 180.151.3.103 port 34540 ssh2', 'restored': 1, 'F-*': {'matches': ['Mar 5 13:45:32 gld-c2-deb-6 sshd[6762]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=180.151.3.103 ', 'Mar 5 13:45:34 gld-c2-deb-6 sshd[6762]: Failed password for invalid user qa from 180.151.3.103 port 34540 ssh2'], 'failures': 3, 'mlfid': ' gld-c2-deb-6 sshd[6762]: ', 'user': 'qa', 'ip4': '180.151.3.103'}, 'ipmatches': 'Mar 5 13:45:32 gld-c2-deb-6 sshd[6762]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=180.151.3.103 \\nMar 5 13:45:34 gld-c2-deb-6 sshd[6762]: Failed password for invalid user qa from 180.151.3.103 port 34540 ssh2', 'ipjailmatches': 'Mar 5 13:45:32 gld-c2-deb-6 sshd[6762]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=180.151.3.103 \\nMar 5 13:45:34 gld-c2-deb-6 sshd[6762]: Failed password for invalid user qa from 180.151.3.103 port 34540 ssh2', 'ipfailures': 3, 'ipjailfailures': 3})': Error unbanning 180.151.3.103\n" "2019-03-06 13:47:45,786 fail2ban.filter [3908]: INFO [sshd] Found 13.72.72.151 - 2019-03-06 13:47:45\n" "2019-03-06 13:47:45,788 fail2ban.filter [3908]: INFO [sshd] Found 13.72.72.151 - 2019-03-06 13:47:45\n" "2019-03-06 13:47:48,492 fail2ban.filter [3908]: INFO [sshd] Found 13.72.72.151 - 2019-03-06 13:47:48\n" "2019-03-06 13:47:48,839 fail2ban.actions [3908]: NOTICE [sshd] Ban 13.72.72.151\n" "2019-03-06 13:50:41,882 fail2ban.server [3908]: INFO 92.184.116.151 is not banned\n" "2019-03-06 13:50:52,355 fail2ban.actions [3908]: NOTICE [sshd] Unban 58.206.100.88\n" "2019-03-06 13:53:17,572 fail2ban.filter [3908]: INFO [sshd] Found 162.243.158.185 - 2019-03-06 13:53:17\n" "2019-03-06 13:53:17,574 fail2ban.filter [3908]: INFO [sshd] Found 162.243.158.185 - 2019-03-06 13:53:17\n" "2019-03-06 13:53:20,280 fail2ban.filter [3908]: INFO [sshd] Found 162.243.158.185 - 2019-03-06 13:53:19\n" "2019-03-06 13:53:20,337 fail2ban.actions [3908]: NOTICE [sshd] Ban 162.243.158.185\n" "2019-03-06 13:54:06,427 fail2ban.filter [3908]: INFO [sshd] Found 139.59.59.90 - 2019-03-06 13:54:06\n" "2019-03-06 13:54:06,433 fail2ban.filter [3908]: INFO [sshd] Found 139.59.59.90 - 2019-03-06 13:54:06\n" "2019-03-06 13:54:08,411 fail2ban.filter [3908]: INFO [sshd] Found 139.59.59.90 - 2019-03-06 13:54:08\n" "2019-03-06 13:54:09,062 fail2ban.actions [3908]: NOTICE [sshd] Ban 139.59.59.90\n" "2019-03-06 13:54:37,400 fail2ban.actions [3908]: NOTICE [sshd] Unban 91.163.112.140\n" "2019-03-06 13:54:37,918 fail2ban.utils [3908]: Level 39 7fef041d70b8 -- exec: iptables -w -D f2b-sshd -s 91.163.112.140 -j REJECT --reject-with icmp-port-unreachable\n" "2019-03-06 13:54:37,919 fail2ban.utils [3908]: ERROR 7fef041d70b8 -- stderr: 'iptables: Bad rule (does a matching rule exist in that chain?).'\n" "2019-03-06 13:54:37,919 fail2ban.utils [3908]: ERROR 7fef041d70b8 -- returned 1\n" "2019-03-06 13:54:37,919 fail2ban.actions [3908]: ERROR Failed to execute unban jail 'sshd' action 'iptables-multiport' info 'ActionInfo({'ip': '91.163.112.140', 'family': 'inet4', 'ip-rev': '140.112.163.91.', 'ip-host': '91-163-112-140.subs.proxad.net', 'fid': '91.163.112.140', 'failures': 3, 'time': 1551811401.836598, 'matches': 'Mar 5 13:54:35 gld-c2-deb-6 sshd[7094]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=91.163.112.140 \\nMar 5 13:54:37 gld-c2-deb-6 sshd[7094]: Failed password for invalid user admin from 91.163.112.140 port 4257 ssh2', 'restored': 1, 'F-*': {'matches': ['Mar 5 13:54:35 gld-c2-deb-6 sshd[7094]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=91.163.112.140 ', 'Mar 5 13:54:37 gld-c2-deb-6 sshd[7094]: Failed password for invalid user admin from 91.163.112.140 port 4257 ssh2'], 'failures': 3, 'mlfid': ' gld-c2-deb-6 sshd[7094]: ', 'user': 'admin', 'ip4': '91.163.112.140'}, 'ipmatches': 'Mar 5 13:54:35 gld-c2-deb-6 sshd[7094]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=91.163.112.140 \\nMar 5 13:54:37 gld-c2-deb-6 sshd[7094]: Failed password for invalid user admin from 91.163.112.140 port 4257 ssh2', 'ipjailmatches': 'Mar 5 13:54:35 gld-c2-deb-6 sshd[7094]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=91.163.112.140 \\nMar 5 13:54:37 gld-c2-deb-6 sshd[7094]: Failed password for invalid user admin from 91.163.112.140 port 4257 ssh2', 'ipfailures': 3, 'ipjailfailures': 3})': Error unbanning 91.163.112.140\n" "2019-03-06 13:54:48,036 fail2ban.actions [3908]: NOTICE [sshd] Unban 222.174.55.2\n" "2019-03-06 13:54:48,228 fail2ban.utils [3908]: Level 39 7fef0428e4f8 -- exec: iptables -w -D f2b-sshd -s 222.174.55.2 -j REJECT --reject-with icmp-port-unreachable\n" "2019-03-06 13:54:48,228 fail2ban.utils [3908]: ERROR 7fef0428e4f8 -- stderr: 'iptables: Bad rule (does a matching rule exist in that chain?).'\n" "2019-03-06 13:54:48,228 fail2ban.utils [3908]: ERROR 7fef0428e4f8 -- returned 1\n" "2019-03-06 13:54:48,229 fail2ban.actions [3908]: ERROR Failed to execute unban jail 'sshd' action 'iptables-multiport' info 'ActionInfo({'ip': '222.174.55.2', 'family': 'inet4', 'ip-rev': '2.55.174.222.', 'ip-host': None, 'fid': '222.174.55.2', 'failures': 3, 'time': 1551811401.8272889, 'matches': 'Mar 5 13:54:45 gld-c2-deb-6 sshd[7109]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.174.55.2 \\nMar 5 13:54:47 gld-c2-deb-6 sshd[7109]: Failed password for invalid user teste from 222.174.55.2 port 46624 ssh2', 'restored': 1, 'F-*': {'matches': ['Mar 5 13:54:45 gld-c2-deb-6 sshd[7109]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.174.55.2 ', 'Mar 5 13:54:47 gld-c2-deb-6 sshd[7109]: Failed password for invalid user teste from 222.174.55.2 port 46624 ssh2'], 'failures': 3, 'mlfid': ' gld-c2-deb-6 sshd[7109]: ', 'user': 'teste', 'ip4': '222.174.55.2'}, 'ipmatches': 'Mar 4 10:15:25 gld-c2-deb-6 sshd[29947]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.174.55.2 \\nMar 4 10:15:26 gld-c2-deb-6 sshd[29947]: Failed password for invalid user qo from 222.174.55.2 port 2368 ssh2\\nMar 5 13:54:45 gld-c2-deb-6 sshd[7109]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.174.55.2 \\nMar 5 13:54:47 gld-c2-deb-6 sshd[7109]: Failed password for invalid user teste from 222.174.55.2 port 46624 ssh2', 'ipjailmatches': 'Mar 4 10:15:25 gld-c2-deb-6 sshd[29947]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.174.55.2 \\nMar 4 10:15:26 gld-c2-deb-6 sshd[29947]: Failed password for invalid user qo from 222.174.55.2 port 2368 ssh2\\nMar 5 13:54:45 gld-c2-deb-6 sshd[7109]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.174.55.2 \\nMar 5 13:54:47 gld-c2-deb-6 sshd[7109]: Failed password for invalid user teste from 222.174.55.2 port 46624 ssh2', 'ipfailures': 6, 'ipjailfailures': 6})': Error unbanning 222.174.55.2\n" "2019-03-06 13:55:06,485 fail2ban.actions [3908]: NOTICE [sshd] Unban 123.23.34.183\n" "2019-03-06 13:55:08,891 fail2ban.utils [3908]: Level 39 7fef040ad360 -- exec: iptables -w -D f2b-sshd -s 123.23.34.183 -j REJECT --reject-with icmp-port-unreachable\n" "2019-03-06 13:55:08,891 fail2ban.utils [3908]: ERROR 7fef040ad360 -- stderr: 'iptables: Bad rule (does a matching rule exist in that chain?).'\n" "2019-03-06 13:55:08,892 fail2ban.utils [3908]: ERROR 7fef040ad360 -- returned 1\n" "2019-03-06 13:55:08,892 fail2ban.actions [3908]: ERROR Failed to execute unban jail 'sshd' action 'iptables-multiport' info 'ActionInfo({'ip': '123.23.34.183', 'family': 'inet4', 'ip-rev': '183.34.23.123.', 'ip-host': None, 'fid': '123.23.34.183', 'failures': 3, 'time': 1551811401.8092942, 'matches': 'Mar 5 13:55:03 gld-c2-deb-6 sshd[7130]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=123.23.34.183 \\nMar 5 13:55:05 gld-c2-deb-6 sshd[7130]: Failed password for invalid user admin from 123.23.34.183 port 34990 ssh2', 'restored': 1, 'F-*': {'matches': ['Mar 5 13:55:03 gld-c2-deb-6 sshd[7130]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=123.23.34.183 ', 'Mar 5 13:55:05 gld-c2-deb-6 sshd[7130]: Failed password for invalid user admin from 123.23.34.183 port 34990 ssh2'], 'failures': 3, 'mlfid': ' gld-c2-deb-6 sshd[7130]: ', 'user': 'admin', 'ip4': '123.23.34.183'}, 'ipmatches': 'Mar 5 13:55:03 gld-c2-deb-6 sshd[7130]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=123.23.34.183 \\nMar 5 13:55:05 gld-c2-deb-6 sshd[7130]: Failed password for invalid user admin from 123.23.34.183 port 34990 ssh2', 'ipjailmatches': 'Mar 5 13:55:03 gld-c2-deb-6 sshd[7130]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=123.23.34.183 \\nMar 5 13:55:05 gld-c2-deb-6 sshd[7130]: Failed password for invalid user admin from 123.23.34.183 port 34990 ssh2', 'ipfailures': 3, 'ipjailfailures': 3})': Error unbanning 123.23.34.183\n" "2019-03-06 13:55:34,846 fail2ban.filter [3908]: INFO [sshd] Found 37.59.99.243 - 2019-03-06 13:55:34\n" "2019-03-06 13:55:34,847 fail2ban.filter [3908]: INFO [sshd] Found 37.59.99.243 - 2019-03-06 13:55:34\n" "2019-03-06 13:55:38,754 fail2ban.filter [3908]: INFO [sshd] Found 37.59.99.243 - 2019-03-06 13:55:37\n" "2019-03-06 13:55:38,984 fail2ban.actions [3908]: NOTICE [sshd] Ban 37.59.99.243\n" "2019-03-06 13:55:44,835 fail2ban.filter [3908]: INFO [sshd] Found 123.206.6.32 - 2019-03-06 13:55:44\n" "2019-03-06 13:55:44,840 fail2ban.filter [3908]: INFO [sshd] Found 123.206.6.32 - 2019-03-06 13:55:44\n" "2019-03-06 13:55:45,663 fail2ban.filter [3908]: INFO [sshd] Found 54.38.240.250 - 2019-03-06 13:55:45\n" "2019-03-06 13:55:45,664 fail2ban.filter [3908]: INFO [sshd] Found 54.38.240.250 - 2019-03-06 13:55:45\n" "2019-03-06 13:55:48,918 fail2ban.filter [3908]: INFO [sshd] Found 123.206.6.32 - 2019-03-06 13:55:46\n" "2019-03-06 14:05:45,730 fail2ban.actions [3908]: NOTICE [sshd] Unban 54.38.240.250\n" "2019-03-06 14:05:45,730 fail2ban.actions [3908]: NOTICE [sshd] Unban 46.209.45.58\n" "2019-03-06 14:05:45,730 fail2ban.actions [3908]: NOTICE [sshd] Unban 61.12.84.13\n" "2019-03-06 14:05:45,730 fail2ban.actions [3908]: NOTICE [sshd] Unban 78.46.88.37\n" "2019-03-06 14:05:45,731 fail2ban.actions [3908]: NOTICE [sshd] Unban 183.82.112.85\n" "2019-03-06 14:05:45,731 fail2ban.actions [3908]: NOTICE [sshd] Unban 157.230.246.150\n" "2019-03-06 14:05:45,731 fail2ban.actions [3908]: NOTICE [sshd] Unban 151.80.144.39\n" "2019-03-06 14:05:50,744 fail2ban.actions [3908]: NOTICE [sshd] Flush ticket(s) with iptables-multiport\n" "2019-03-06 14:06:15,741 fail2ban.server [3908]: INFO Shutdown in progress...\n" "2019-03-06 14:06:15,742 fail2ban.server [3908]: INFO Stopping all jails\n" "2019-03-06 14:06:15,743 fail2ban.filter [3908]: INFO Removed logfile: '/var/log/auth.log'\n" "2019-03-06 14:06:16,316 fail2ban.actions [3908]: NOTICE [sshd] Flush ticket(s) with iptables-multiport\n" "2019-03-06 14:06:18,986 fail2ban.jail [3908]: INFO Jail 'sshd' stopped\n" "2019-03-06 14:06:18,987 fail2ban.database [3908]: INFO Connection to database closed.\n" "2019-03-06 14:06:18,988 fail2ban.server [3908]: INFO Exiting Fail2ban\n" "2019-03-06 14:06:19,257 fail2ban.server [12641]: INFO --------------------------------------------------\n" "2019-03-06 14:06:19,257 fail2ban.server [12641]: INFO Starting Fail2ban v0.10.2\n" "2019-03-06 14:06:19,266 fail2ban.database [12641]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'\n" "2019-03-06 14:06:19,269 fail2ban.jail [12641]: INFO Creating new jail 'sshd'\n" "2019-03-06 14:06:19,288 fail2ban.jail [12641]: INFO Jail 'sshd' uses pyinotify {}\n" "2019-03-06 14:06:19,293 fail2ban.jail [12641]: INFO Initiated 'pyinotify' backend\n" "2019-03-06 14:06:19,295 fail2ban.filter [12641]: INFO maxLines: 1\n" "2019-03-06 14:06:19,368 fail2ban.server [12641]: INFO Jail sshd is not a JournalFilter instance\n" "2019-03-06 14:06:19,369 fail2ban.filter [12641]: INFO Added logfile: '/var/log/auth.log' (pos = 3732751, hash = 1a7be9b89f9612a58a059d4b957ad4a532073aca)\n" "2019-03-06 14:06:19,371 fail2ban.filter [12641]: INFO encoding: utf-8\n" "2019-03-06 14:06:19,371 fail2ban.filter [12641]: INFO maxRetry: 3\n" "2019-03-06 14:06:19,372 fail2ban.filter [12641]: INFO findtime: 600\n" "2019-03-06 14:06:19,372 fail2ban.actions [12641]: INFO banTime: 86400\n" "2019-03-06 14:06:19,377 fail2ban.jail [12641]: INFO Jail 'sshd' started\n" "2019-03-06 14:06:22,861 fail2ban.actions [12641]: NOTICE [sshd] Flush ticket(s) with iptables-multiport\n" "2019-03-06 14:06:23,130 fail2ban.filter [12641]: INFO [sshd] Found 134.175.141.166 - 2019-03-06 14:06:22\n" "2019-03-06 14:06:23,132 fail2ban.filter [12641]: INFO [sshd] Found 134.175.141.166 - 2019-03-06 14:06:22\n" "2019-03-06 14:06:25,014 fail2ban.filter [12641]: INFO [sshd] Found 134.175.141.166 - 2019-03-06 14:06:25\n" "2019-03-06 14:06:25,345 fail2ban.actions [12641]: NOTICE [sshd] Ban 134.175.141.166\n" "2019-03-06 14:06:29,124 fail2ban.server [12641]: INFO Shutdown in progress...\n" "2019-03-06 14:06:29,124 fail2ban.server [12641]: INFO Stopping all jails\n" "2019-03-06 14:06:29,125 fail2ban.filter [12641]: INFO Removed logfile: '/var/log/auth.log'\n" "2019-03-06 14:06:29,255 fail2ban.actions [12641]: NOTICE [sshd] Flush ticket(s) with iptables-multiport\n" "2019-03-06 14:06:29,335 fail2ban.actions [12641]: NOTICE [sshd] Unban 134.175.141.166\n" "2019-03-06 14:06:29,726 fail2ban.jail [12641]: INFO Jail 'sshd' stopped\n" "2019-03-06 14:06:29,728 fail2ban.database [12641]: INFO Connection to database closed.\n" "2019-03-06 14:06:29,728 fail2ban.server [12641]: INFO Exiting Fail2ban\n" "2019-03-06 14:06:30,349 fail2ban.server [12676]: INFO --------------------------------------------------\n" "2019-03-06 14:06:30,349 fail2ban.server [12676]: INFO Starting Fail2ban v0.10.2\n" "2019-03-06 14:06:30,364 fail2ban.database [12676]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'\n" "2019-03-06 14:06:30,366 fail2ban.jail [12676]: INFO Creating new jail 'sshd'\n" "2019-03-06 14:06:30,386 fail2ban.jail [12676]: INFO Jail 'sshd' uses pyinotify {}\n" "2019-03-06 14:06:30,391 fail2ban.jail [12676]: INFO Initiated 'pyinotify' backend\n" "2019-03-06 14:06:30,393 fail2ban.filter [12676]: INFO maxLines: 1\n" "2019-03-06 14:06:30,453 fail2ban.server [12676]: INFO Jail sshd is not a JournalFilter instance\n" "2019-03-06 14:06:30,455 fail2ban.filter [12676]: INFO Added logfile: '/var/log/auth.log' (pos = 3733518, hash = 1a7be9b89f9612a58a059d4b957ad4a532073aca)\n" "2019-03-06 14:06:30,456 fail2ban.filter [12676]: INFO encoding: utf-8\n" "2019-03-06 14:06:30,457 fail2ban.filter [12676]: INFO maxRetry: 3\n" "2019-03-06 14:06:30,458 fail2ban.filter [12676]: INFO findtime: 600\n" "2019-03-06 14:06:30,458 fail2ban.actions [12676]: INFO banTime: 86400\n" "2019-03-06 14:06:31,238 fail2ban.jail [12676]: INFO Jail 'sshd' started\n" "2019-03-06 14:06:31,664 fail2ban.actions [12676]: NOTICE [sshd] Restore Ban 134.175.141.166\n" "2019-03-06 14:06:46,255 fail2ban.filter [12676]: INFO [sshd] Found 61.12.84.13 - 2019-03-06 14:06:46\n" "2019-03-06 14:06:46,743 fail2ban.filter [12676]: INFO [sshd] Found 61.12.84.13 - 2019-03-06 14:06:46\n" "2019-03-06 14:06:48,389 fail2ban.filter [12676]: INFO [sshd] Found 61.12.84.13 - 2019-03-06 14:06:48\n" "2019-03-06 14:06:48,495 fail2ban.actions [12676]: NOTICE [sshd] Ban 61.12.84.13\n" "2019-03-06 14:08:08,729 fail2ban.filter [12676]: INFO [sshd] Found 157.230.246.150 - 2019-03-06 14:08:08\n" "2019-03-06 14:08:08,731 fail2ban.filter [12676]: INFO [sshd] Found 157.230.246.150 - 2019-03-06 14:08:08\n" "2019-03-06 14:08:10,575 fail2ban.filter [12676]: INFO [sshd] Found 157.230.246.150 - 2019-03-06 14:08:10\n" "2019-03-06 14:08:10,645 fail2ban.actions [12676]: NOTICE [sshd] Ban 157.230.246.150\n" "2019-03-06 14:09:19,339 fail2ban.filter [12676]: INFO [sshd] Found 45.118.145.51 - 2019-03-06 14:09:19\n" "2019-03-06 14:09:20,992 fail2ban.filter [12676]: INFO [sshd] Found 45.118.145.51 - 2019-03-06 14:09:20\n" "2019-03-06 14:10:29,439 fail2ban.filter [12676]: INFO [sshd] Found 151.80.144.39 - 2019-03-06 14:10:29\n" "2019-03-06 14:10:29,440 fail2ban.filter [12676]: INFO [sshd] Found 151.80.144.39 - 2019-03-06 14:10:29\n" "2019-03-06 14:10:31,044 fail2ban.filter [12676]: INFO [sshd] Found 151.80.144.39 - 2019-03-06 14:10:30\n" "2019-03-06 14:10:31,840 fail2ban.actions [12676]: NOTICE [sshd] Ban 151.80.144.39\n" "2019-03-06 14:11:12,566 fail2ban.filter [12676]: INFO [sshd] Found 142.93.219.252 - 2019-03-06 14:11:12\n" "2019-03-06 14:11:12,569 fail2ban.filter [12676]: INFO [sshd] Found 142.93.219.252 - 2019-03-06 14:11:12\n" "2019-03-06 14:11:14,419 fail2ban.filter [12676]: INFO [sshd] Found 142.93.219.252 - 2019-03-06 14:11:14\n" "2019-03-06 14:11:14,428 fail2ban.actions [12676]: NOTICE [sshd] Ban 142.93.219.252\n" "2019-03-06 14:11:41,758 fail2ban.filter [12676]: INFO [sshd] Found 66.98.79.181 - 2019-03-06 14:11:41\n" "2019-03-06 14:11:41,759 fail2ban.filter [12676]: INFO [sshd] Found 66.98.79.181 - 2019-03-06 14:11:41\n" "2019-03-06 14:11:43,363 fail2ban.filter [12676]: INFO [sshd] Found 66.98.79.181 - 2019-03-06 14:11:43\n" "2019-03-06 14:11:43,920 fail2ban.actions [12676]: NOTICE [sshd] Ban 66.98.79.181\n" "2019-03-06 14:14:39,047 fail2ban.server [12676]: INFO Shutdown in progress...\n" "2019-03-06 14:14:39,048 fail2ban.server [12676]: INFO Stopping all jails\n" "2019-03-06 14:14:39,048 fail2ban.filter [12676]: INFO Removed logfile: '/var/log/auth.log'\n" "2019-03-06 14:14:39,311 fail2ban.actions [12676]: NOTICE [sshd] Flush ticket(s) with iptables-multiport\n" "2019-03-06 14:14:39,555 fail2ban.actions [12676]: NOTICE [sshd] Unban 134.175.141.166\n" "2019-03-06 14:14:39,556 fail2ban.actions [12676]: NOTICE [sshd] Unban 61.12.84.13\n" "2019-03-06 14:14:39,556 fail2ban.actions [12676]: NOTICE [sshd] Unban 157.230.246.150\n" "2019-03-06 14:14:39,556 fail2ban.actions [12676]: NOTICE [sshd] Unban 151.80.144.39\n" "2019-03-06 14:14:39,556 fail2ban.actions [12676]: NOTICE [sshd] Unban 142.93.219.252\n" "2019-03-06 14:14:39,557 fail2ban.actions [12676]: NOTICE [sshd] Unban 66.98.79.181\n" "2019-03-06 14:14:39,836 fail2ban.jail [12676]: INFO Jail 'sshd' stopped\n" "2019-03-06 14:14:39,837 fail2ban.database [12676]: INFO Connection to database closed.\n" "2019-03-06 14:14:39,838 fail2ban.server [12676]: INFO Exiting Fail2ban\n" "2019-03-06 14:14:40,109 fail2ban.server [13651]: INFO --------------------------------------------------\n" "2019-03-06 14:14:40,109 fail2ban.server [13651]: INFO Starting Fail2ban v0.10.2\n" "2019-03-06 14:14:40,118 fail2ban.database [13651]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'\n" "2019-03-06 14:14:40,120 fail2ban.jail [13651]: INFO Creating new jail 'sshd'\n" "2019-03-06 14:14:40,140 fail2ban.jail [13651]: INFO Jail 'sshd' uses pyinotify {}\n" "2019-03-06 14:14:40,145 fail2ban.jail [13651]: INFO Initiated 'pyinotify' backend\n" "2019-03-06 14:14:40,147 fail2ban.filter [13651]: INFO maxLines: 1\n" "2019-03-06 14:14:40,207 fail2ban.server [13651]: INFO Jail sshd is not a JournalFilter instance\n" "2019-03-06 14:14:40,208 fail2ban.filter [13651]: INFO Added logfile: '/var/log/auth.log' (pos = 3737780, hash = 1a7be9b89f9612a58a059d4b957ad4a532073aca)\n" "2019-03-06 14:14:40,210 fail2ban.filter [13651]: INFO encoding: utf-8\n" "2019-03-06 14:14:40,211 fail2ban.filter [13651]: INFO maxRetry: 3\n" "2019-03-06 14:14:40,211 fail2ban.filter [13651]: INFO findtime: 1800\n" "2019-03-06 14:14:40,212 fail2ban.actions [13651]: INFO banTime: 172800\n" "2019-03-06 14:14:40,257 fail2ban.jail [13651]: INFO Jail 'sshd' started\n" "2019-03-06 14:14:40,417 fail2ban.actions [13651]: NOTICE [sshd] Restore Ban 134.175.141.166\n" "2019-03-06 14:14:41,175 fail2ban.actions [13651]: NOTICE [sshd] Restore Ban 142.93.219.252\n" "2019-03-06 14:14:41,717 fail2ban.actions [13651]: NOTICE [sshd] Restore Ban 151.80.144.39\n" "2019-03-06 14:14:42,006 fail2ban.actions [13651]: NOTICE [sshd] Restore Ban 157.230.246.150\n" "2019-03-06 14:14:42,067 fail2ban.filter [13651]: INFO [sshd] Found 47.23.130.246 - 2019-03-06 14:14:42\n" "2019-03-06 14:14:42,162 fail2ban.filter [13651]: INFO [sshd] Found 47.23.130.246 - 2019-03-06 14:14:42\n" "2019-03-06 14:14:42,276 fail2ban.actions [13651]: NOTICE [sshd] Restore Ban 61.12.84.13\n" "2019-03-06 14:14:42,536 fail2ban.actions [13651]: NOTICE [sshd] Restore Ban 66.98.79.181\n" "2019-03-06 14:14:44,155 fail2ban.filter [13651]: INFO [sshd] Found 47.23.130.246 - 2019-03-06 14:14:44\n" "2019-03-06 14:14:44,818 fail2ban.actions [13651]: NOTICE [sshd] Ban 47.23.130.246\n" "2019-03-06 14:19:17,526 fail2ban.filter [13651]: INFO [sshd] Found 219.147.168.103 - 2019-03-06 14:19:17\n" "2019-03-06 14:19:17,532 fail2ban.filter [13651]: INFO [sshd] Found 219.147.168.103 - 2019-03-06 14:19:17\n" "2019-03-06 14:19:19,611 fail2ban.filter [13651]: INFO [sshd] Found 219.147.168.103 - 2019-03-06 14:19:19\n" "2019-03-06 14:19:19,788 fail2ban.actions [13651]: NOTICE [sshd] Ban 219.147.168.103\n" "2019-03-06 14:39:41,489 fail2ban.filter [13651]: INFO [sshd] Found 104.248.211.180 - 2019-03-06 14:39:41\n" "2019-03-06 14:39:41,494 fail2ban.filter [13651]: INFO [sshd] Found 104.248.211.180 - 2019-03-06 14:39:41\n" "2019-03-06 14:39:44,199 fail2ban.filter [13651]: INFO [sshd] Found 104.248.211.180 - 2019-03-06 14:39:43\n" "2019-03-06 14:39:44,201 fail2ban.actions [13651]: NOTICE [sshd] Ban 104.248.211.180\n" "2019-03-06 14:41:00,193 fail2ban.filter [13651]: INFO [sshd] Found 92.42.108.115 - 2019-03-06 14:40:59\n" "2019-03-06 14:41:00,195 fail2ban.filter [13651]: INFO [sshd] Found 92.42.108.115 - 2019-03-06 14:40:59\n" "2019-03-06 14:41:02,010 fail2ban.filter [13651]: INFO [sshd] Found 92.42.108.115 - 2019-03-06 14:41:02\n" "2019-03-06 14:41:02,604 fail2ban.actions [13651]: NOTICE [sshd] Ban 92.42.108.115\n" "2019-03-06 14:41:05,238 fail2ban.filter [13651]: INFO [sshd] Found 58.87.79.29 - 2019-03-06 14:41:05\n" "2019-03-06 14:41:05,244 fail2ban.filter [13651]: INFO [sshd] Found 58.87.79.29 - 2019-03-06 14:41:05\n" "2019-03-06 14:41:09,362 fail2ban.filter [13651]: INFO [sshd] Found 58.87.79.29 - 2019-03-06 14:41:06\n" "2019-03-06 14:41:09,762 fail2ban.actions [13651]: NOTICE [sshd] Ban 58.87.79.29\n" "2019-03-06 14:43:33,266 fail2ban.server [13651]: INFO Shutdown in progress...\n" "2019-03-06 14:43:33,267 fail2ban.server [13651]: INFO Stopping all jails\n" "2019-03-06 14:43:33,268 fail2ban.filter [13651]: INFO Removed logfile: '/var/log/auth.log'\n" "2019-03-06 14:43:33,514 fail2ban.actions [13651]: NOTICE [sshd] Flush ticket(s) with iptables-multiport\n" "2019-03-06 14:43:33,595 fail2ban.actions [13651]: NOTICE [sshd] Unban 134.175.141.166\n" "2019-03-06 14:43:33,595 fail2ban.actions [13651]: NOTICE [sshd] Unban 142.93.219.252\n" "2019-03-06 14:43:33,595 fail2ban.actions [13651]: NOTICE [sshd] Unban 151.80.144.39\n" "2019-03-06 14:43:33,595 fail2ban.actions [13651]: NOTICE [sshd] Unban 157.230.246.150\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 61.12.84.13\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 66.98.79.181\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 47.23.130.246\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 219.147.168.103\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 202.82.10.241\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 123.126.34.7\n" "2019-03-06 14:43:33,596 fail2ban.actions [13651]: NOTICE [sshd] Unban 37.59.34.66\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 139.59.21.101\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 211.250.189.64\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 190.98.228.54\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 183.101.8.161\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 139.59.228.147\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 165.227.49.242\n" "2019-03-06 14:43:33,597 fail2ban.actions [13651]: NOTICE [sshd] Unban 5.196.75.47\n" "2019-03-06 14:43:33,598 fail2ban.actions [13651]: NOTICE [sshd] Unban 138.122.86.54\n" "2019-03-06 14:43:33,598 fail2ban.actions [13651]: NOTICE [sshd] Unban 104.248.211.180\n" "2019-03-06 14:43:33,598 fail2ban.actions [13651]: NOTICE [sshd] Unban 92.42.108.115\n" "2019-03-06 14:43:33,598 fail2ban.actions [13651]: NOTICE [sshd] Unban 58.87.79.29\n" "2019-03-06 14:43:33,869 fail2ban.jail [13651]: INFO Jail 'sshd' stopped\n" "2019-03-06 14:43:33,870 fail2ban.database [13651]: INFO Connection to database closed.\n" "2019-03-06 14:43:33,871 fail2ban.server [13651]: INFO Exiting Fail2ban\n" "2019-03-06 14:43:34,141 fail2ban.server [16973]: INFO --------------------------------------------------\n" "2019-03-06 14:43:34,141 fail2ban.server [16973]: INFO Starting Fail2ban v0.10.2\n" "2019-03-06 14:43:34,150 fail2ban.database [16973]: INFO Connected to fail2ban persistent database '/var/lib/fail2ban/fail2ban.sqlite3'\n" "2019-03-06 14:43:34,153 fail2ban.jail [16973]: INFO Creating new jail 'sshd'\n" "2019-03-06 14:43:34,172 fail2ban.jail [16973]: INFO Jail 'sshd' uses pyinotify {}\n" "2019-03-06 14:43:34,177 fail2ban.jail [16973]: INFO Initiated 'pyinotify' backend\n" "2019-03-06 14:43:34,179 fail2ban.filter [16973]: INFO maxLines: 1\n" "2019-03-06 14:43:34,243 fail2ban.server [16973]: INFO Jail sshd is not a JournalFilter instance\n" "2019-03-06 14:43:34,244 fail2ban.filter [16973]: INFO Added logfile: '/var/log/auth.log' (pos = 3749382, hash = 1a7be9b89f9612a58a059d4b957ad4a532073aca)\n" "2019-03-06 14:43:34,246 fail2ban.filter [16973]: INFO encoding: utf-8\n" "2019-03-06 14:43:34,246 fail2ban.filter [16973]: INFO maxRetry: 3\n" "2019-03-06 14:43:34,247 fail2ban.filter [16973]: INFO findtime: 1200\n" "2019-03-06 14:43:34,247 fail2ban.actions [16973]: INFO banTime: 172800\n" "2019-03-06 14:43:34,274 fail2ban.jail [16973]: INFO Jail 'sshd' started\n" "2019-03-06 14:43:34,452 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 104.248.211.180\n" "2019-03-06 14:43:35,026 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 123.126.34.7\n" "2019-03-06 14:43:35,526 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 134.175.141.166\n" "2019-03-06 14:43:38,690 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 138.122.86.54\n" "2019-03-06 14:43:39,416 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 139.59.21.101\n" "2019-03-06 14:43:39,735 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 139.59.228.147\n" "2019-03-06 14:43:41,706 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 142.93.219.252\n" "2019-03-06 14:43:41,976 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 151.80.144.39\n" "2019-03-06 14:43:42,276 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 157.230.246.150\n" "2019-03-06 14:43:42,545 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 165.227.49.242\n" "2019-03-06 14:43:44,726 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 5.196.75.47\n" "2019-03-06 14:43:45,006 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 58.87.79.29\n" "2019-03-06 14:43:45,386 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 61.12.84.13\n" "2019-03-06 14:43:45,876 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 66.98.79.181\n" "2019-03-06 14:43:49,546 fail2ban.actions [16973]: NOTICE [sshd] Restore Ban 92.42.108.115\n" "2019-03-06 14:45:44,274 fail2ban.filter [16973]: INFO [sshd] Found 177.242.110.54 - 2019-03-06 14:45:44\n" "2019-03-06 14:45:44,275 fail2ban.filter [16973]: INFO [sshd] Found 177.242.110.54 - 2019-03-06 14:45:44\n" "2019-03-06 14:45:46,980 fail2ban.filter [16973]: INFO [sshd] Found 177.242.110.54 - 2019-03-06 14:45:46\n" "2019-03-06 14:45:47,094 fail2ban.actions [16973]: NOTICE [sshd] Ban 177.242.110.54\n" "2019-03-06 14:46:52,374 fail2ban.filter [16973]: INFO [sshd] Found 112.253.8.106 - 2019-03-06 14:46:52\n" "2019-03-06 14:46:54,321 fail2ban.filter [16973]: INFO [sshd] Found 112.253.8.106 - 2019-03-06 14:46:54\n" "2019-03-06 14:47:02,108 fail2ban.filter [16973]: INFO [sshd] Found 112.253.8.106 - 2019-03-06 14:47:01\n" "2019-03-06 14:47:02,463 fail2ban.actions [16973]: NOTICE [sshd] Ban 112.253.8.106\n" "2019-03-06 14:47:03,796 fail2ban.filter [16973]: INFO [sshd] Found 112.253.8.106 - 2019-03-06 14:47:03\n" "2019-03-06 14:47:51,987 fail2ban.filter [16973]: INFO [sshd] Found 116.68.249.19 - 2019-03-06 14:47:51\n" "2019-03-06 14:47:51,989 fail2ban.filter [16973]: INFO [sshd] Found 116.68.249.19 - 2019-03-06 14:47:51\n" "2019-03-06 14:47:53,515 fail2ban.filter [16973]: INFO [sshd] Found 116.68.249.19 - 2019-03-06 14:47:53\n" "2019-03-06 14:47:54,216 fail2ban.actions [16973]: NOTICE [sshd] Ban 116.68.249.19") matches = re.finditer(regex, test_str, re.MULTILINE) for matchNum, match in enumerate(matches, start=1): print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group())) for groupNum in range(0, len(match.groups())): groupNum = groupNum + 1 print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum))) # Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html