GithubHelp home page GithubHelp logo

Comments (5)

bazsi avatar bazsi commented on July 20, 2024

Hmm.. what about the $FACILITY_NUM and $LEVEL_NUM macros? they extract the numeric value of the facility and severity (which is called level because of historical reasons).

Likewise, $PROGRAM and $PID is available.

Or you mean, you want to parse incoming messages that way?

from syslog-ng.

faxm0dem avatar faxm0dem commented on July 20, 2024

yes, my initial request was to expose the parsing procedures explicitly into template functions, so that users can use them manually in cases the syslog-protocol isn't being used.

from syslog-ng.

bazsi avatar bazsi commented on July 20, 2024

there's syslog-parser() which can be used to reparse a message as syslog formatted.

something along the lines:

parser p_xxx {
syslog-parser()
};

you can also pass flags option just like with a source:
{ "no-parse", CFH_SET, offsetof(MsgFormatOptions, flags), LP_NOPARSE },
{ "check-hostname", CFH_SET, offsetof(MsgFormatOptions, flags), LP_CHECK_HOSTNAME },
{ "syslog-protocol", CFH_SET, offsetof(MsgFormatOptions, flags), LP_SYSLOG_PROTOCOL },
{ "assume-utf8", CFH_SET, offsetof(MsgFormatOptions, flags), LP_ASSUME_UTF8 },
{ "validate-utf8", CFH_SET, offsetof(MsgFormatOptions, flags), LP_VALIDATE_UTF8 },
{ "no-multi-line", CFH_SET, offsetof(MsgFormatOptions, flags), LP_NO_MULTI_LINE },
{ "store-legacy-msghdr", CFH_SET, offsetof(MsgFormatOptions, flags), LP_STORE_LEGACY_MSGHDR },
{ "dont-store-legacy-msghdr", CFH_CLEAR, offsetof(MsgFormatOptions, flags), LP_STORE_LEGACY_MSGHDR },
{ "expect-hostname", CFH_SET, offsetof(MsgFormatOptions, flags), LP_EXPECT_HOSTNAME },
{ "no-hostname", CFH_CLEAR, offsetof(MsgFormatOptions, flags), LP_EXPECT_HOSTNAME },

from syslog-ng.

faxm0dem avatar faxm0dem commented on July 20, 2024

hrm okay, but will this let me parse e.g. just the PRI?

from syslog-ng.

talien avatar talien commented on July 20, 2024

The grok parser in the upcoming incubator release 0.4.0 can solve this problem.

from syslog-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.