1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/syslog_bsd.md
Kelly Brazil 5f280c3e24 doc update
2022-08-12 10:16:15 -07:00

1.1 KiB

Home

jc.parsers.syslog_bsd

jc - JSON Convert Syslog RFC 3164 string parser

<>

Usage (cli):

$ syslogstring | jc --syslog-bsd

or

$ jc syslog-3164

Usage (module):

import jc
result = jc.parse('syslog_bsd', syslog_command_output)

Schema:

[
  {
    "syslog-3164":     string,
    "bar":     boolean,
    "baz":     integer
  }
]

Examples:

$ syslog-3164 | jc --syslog-3164 -p
[]

$ syslog-3164 | jc --syslog-3164 -p -r
[]

parse

def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]

Main text parsing function

Parameters:

data:        (string)  text data to parse
raw:         (boolean) unprocessed output if True
quiet:       (boolean) suppress warning messages if True

Returns:

List of Dictionaries. Raw or processed structured data.

Parser Information

Compatibility: linux, darwin, cygwin, win32, aix, freebsd

Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)