The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 5.0

  • Change: 6ca871f422f19a4374187a3a78e0066db774fd47 Author: Brad Lhotsky <brad@divisionbyzero.net> Date : 2022-11-13 20:46:30 +0000
    • Updates for the 5.0 Release
    • Breaking Changes ================
    • Shipping with `RFC5424StructuredData` enabled and set to true.
    • The biggest effect this could have on users, is the `content` field is now stripped of the components of RFC structured data.
    • Given:
    • ``` <163>Jul 26 15:50:14 ether janus foobar[4291]: [lvl=2] [foo x=1] some content [bar x=2] ```
    • The old behavior with the defaults would produce the following:
    • ``` content => '[lvl=2] [foo x=1] some content [bar x=2]', ```
    • As of 5.x, this is changed and will now produce:
    • ``` content => 'some content', SDATA => {
    • bar => {
    • x => 2,
    • },
    • foo => {,
    • x => 1,
    • },
    • lvl => 2, }, ```
    • The intent is this change makes the module even more useful as it defaults to parsing structured data correctly according to the RFC. To restore the prior functionality, you can disable this feature.
    • ``` $Parse::Syslog::Line::RFC5424StructuredData = 0; ```
    • Improvements ============
    • Make `JSON::MaybeXS` a requirement, recommend `Cpanel::JSON::XS` * Remove all `use JSON` from the code * Split up the k/v regex using `/x` so it's more maintainable * Add support for simplistic RFC structured data, ala, `[group k=v]` * Add tests for the RFC structured data parsing * Add `RFC5424StructuredDataStrict` and tests for strict parsing * Squelch warnings in tests and benchmarks * Document environment variables that interact with `Parse::Syslog::Line`

Documentation

Parse a syslog message and display the structured data

Modules

Simple syslog line parser