mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
formatting
This commit is contained in:
@ -38,6 +38,8 @@ Schema:
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Blank values will be null/None
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ syslog-5424 | jc --syslog-5424 -p
|
$ syslog-5424 | jc --syslog-5424 -p
|
||||||
@ -133,7 +135,6 @@ def _process(proc_data: List[Dict]) -> List[Dict]:
|
|||||||
item['message'] = item['message'].replace(esc, esc_sub)
|
item['message'] = item['message'].replace(esc, esc_sub)
|
||||||
|
|
||||||
# parse identity and key value pairs in the structured data section
|
# parse identity and key value pairs in the structured data section
|
||||||
structs = None
|
|
||||||
if item['structured_data']:
|
if item['structured_data']:
|
||||||
structs_list = []
|
structs_list = []
|
||||||
structs = _extract_structs(item['structured_data'])
|
structs = _extract_structs(item['structured_data'])
|
||||||
@ -184,7 +185,8 @@ def parse(
|
|||||||
syslog = re.compile(r'''
|
syslog = re.compile(r'''
|
||||||
(?P<priority><(\d|\d{2}|1[1-8]\d|19[01])>)?
|
(?P<priority><(\d|\d{2}|1[1-8]\d|19[01])>)?
|
||||||
(?P<version>\d{1,2})?\s*
|
(?P<version>\d{1,2})?\s*
|
||||||
(?P<timestamp>-|(?P<fullyear>[12]\d{3})-
|
(?P<timestamp>-|
|
||||||
|
(?P<fullyear>[12]\d{3})-
|
||||||
(?P<month>0\d|[1][012])-
|
(?P<month>0\d|[1][012])-
|
||||||
(?P<mday>[012]\d|3[01])T
|
(?P<mday>[012]\d|3[01])T
|
||||||
(?P<hour>[01]\d|2[0-4]):
|
(?P<hour>[01]\d|2[0-4]):
|
||||||
|
Reference in New Issue
Block a user