Skip to content

Use tags for incorrect input reporting#4804

Merged
alltilla merged 10 commits intosyslog-ng:masterfrom
bazsi:use-tags-for-incorrect-input-reporting
Jan 29, 2024
Merged

Use tags for incorrect input reporting#4804
alltilla merged 10 commits intosyslog-ng:masterfrom
bazsi:use-tags-for-incorrect-input-reporting

Conversation

@bazsi
Copy link
Collaborator

@bazsi bazsi commented Jan 29, 2024

This PR makes it possible to report syslog parsing problems as builtin tags (e.g. named bit-like properties of the message).

These are the builtin tags:

/* means that the message is not valid utf8 /
LM_T_MSG_UTF8_SANITIZED,
/
msg-format parsing failed, "Error parsing ..." /
LM_T_MSG_PARSE_ERROR,
/
missing value /
LM_T_SYSLOG_MISSING_PRI,
/
no timestamp present in the original message /
LM_T_SYSLOG_MISSING_TIMESTAMP,
/
hostname field does not seem valid, check-hostname(yes) failed /
LM_T_SYSLOG_INVALID_HOSTNAME,
/
we seem to have found an octet count in front of the message /
LM_T_SYSLOG_UNEXPECTED_FRAMING,
/
no date & host information in the syslog message /
LM_T_SYSLOG_RFC3164_MISSING_HEADER,
/
incorrectly quoted RFC5424 SDATA */
LM_T_SYSLOG_RFC5424_UNQUOTED_SDATA_VALUE,

It also contains a $(tags-head) template function and some refactoring steps.

There was a case in rfc5424 parsing where the current timezone offset
was not using a cached time value, let's use that instead, just like
RFC3164.

Signed-off-by: Balazs Scheidler <[email protected]>
@kira-syslogng
Copy link
Contributor

Build FAILURE

bazsi added 9 commits January 29, 2024 16:48
Signed-off-by: Balazs Scheidler <[email protected]>
To ensure that syslog specific formatting issues can be reported efficiently
by tags, register those as predefined tags in the core.

I made an attempt to register these to be syslogformat specific, however
parts of the configuration may start using the new tags _before_
syslogformat is loaded, causing an incorrect registration of the tags in
question.

Signed-off-by: Balazs Scheidler <[email protected]>
This template function returns the first tag that is set from the list
specified.

Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the use-tags-for-incorrect-input-reporting branch from ea6252f to 386087b Compare January 29, 2024 15:48
@alltilla alltilla merged commit 190651c into syslog-ng:master Jan 29, 2024
alltilla added a commit to alltilla/syslog-ng that referenced this pull request Feb 12, 2024
MrAnno added a commit that referenced this pull request Feb 12, 2024
bshifter pushed a commit to bshifter/syslog-ng that referenced this pull request Feb 19, 2024
bshifter pushed a commit to bshifter/syslog-ng that referenced this pull request Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants