1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

regex formatting

This commit is contained in:
Kelly Brazil
2022-08-16 15:59:08 -07:00
parent 2e9b9ab987
commit 4b9ed91546

View File

@ -118,8 +118,10 @@ def parse(
# inspired by https://gist.github.com/miticojo/b16bb13e78572c2d2fac82d9516d5c32
syslog = re.compile(r'''
(?P<priority><\d{1,3}>)?
(?P<date>[A-Z][a-z][a-z]\s{1,2}\d{1,2}\s\d{2}?:\d{2}:\d{2})?\s
(?P<host>[\w][\w\d\.:@-]*)?\s
(?P<header>
(?P<date>[A-Z][a-z][a-z]\s{1,2}\d{1,2}\s\d{2}?:\d{2}:\d{2})?\s
(?P<host>[\w][\w\d\.:@-]*)?\s
)
(?P<msg>
(?P<tag>\w+)?
(?P<content>.*)