Skip to content

check program name for rfc3164#380

Merged
MrAnno merged 5 commits intoaxoflow:mainfrom
bshifter:logmsg-check-program
Nov 18, 2024
Merged

check program name for rfc3164#380
MrAnno merged 5 commits intoaxoflow:mainfrom
bshifter:logmsg-check-program

Conversation

@bshifter
Copy link
Member

The check-program flag was added to validate the program field in syslog format. It verifies that the program field contains only the allowed characters '[a-zA-Z0-9].-_/()' and requires at least one alphabetical character in the program name. If these conditions are not met, it treats the program field and the remaining fields as part of the log message. This approach avoids using regular expressions to improve performance.

examples:

log {
    source { tcp(port(2000) flags(check-hostname, check-program, dont-store-legacy-msghdr)); };
...

@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2024

This Pull Request introduces config grammar changes

axoflow/0b99654805acc81e18d5d0cf1c6c3e25fac92b9d -> bshifter/logmsg-check-program

Details
--- a/options
+++ b/options

 global-options(
+    check-program(<yesno>)
 )

--- a/parser
+++ b/parser

 syslog-parser(
     flags(
+        check-program
     )
 )

--- a/source
+++ b/source

 fifo(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 file(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 network(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 pipe(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 program(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 stdin(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 syslog(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 systemd-syslog(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 tcp(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 tcp6(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 udp(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 udp6(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 unix-dgram(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 unix-stream(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

 wildcard-file(
+    check-program(<yesno>)
     flags(
+        check-program
     )
 )

@bshifter bshifter changed the title axorouter-framework: check program name for rfc3164 check program name for rfc3164 Nov 14, 2024
@bshifter bshifter force-pushed the logmsg-check-program branch from 4bd3790 to fd113ac Compare November 14, 2024 14:09
Copy link
Contributor

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

(We may also need a NEWS file entry).

@bshifter bshifter force-pushed the logmsg-check-program branch from fd113ac to ad3a54d Compare November 15, 2024 15:43
@MrAnno MrAnno self-requested a review November 17, 2024 22:53
@MrAnno
Copy link
Contributor

MrAnno commented Nov 18, 2024

LGTM. We can merge it after adding a news entry.

@bshifter bshifter force-pushed the logmsg-check-program branch 2 times, most recently from 651e705 to 889b8b7 Compare November 18, 2024 14:40
MrAnno
MrAnno previously approved these changes Nov 18, 2024
@MrAnno MrAnno merged commit e152a6c into axoflow:main Nov 18, 2024
fekete-robert pushed a commit to axoflow/axosyslog-core-docs that referenced this pull request Feb 15, 2025
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.

2 participants