Skip to content

Conversation

HofiOne
Copy link
Collaborator

@HofiOne HofiOne commented Mar 17, 2025

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)); };
...

Backport of 380 by @bshifter

Signed-off-by: shifter <shifter@axoflow.com>
Signed-off-by: shifter <shifter@axoflow.com>
Signed-off-by: shifter <shifter@axoflow.com>
@HofiOne HofiOne force-pushed the backport/logmsg-check-program branch from c9da974 to 74e9ffe Compare March 17, 2025 10:28
Copy link
Contributor

This Pull Request introduces config grammar changes

syslog-ng/600b1e8e267af83961acd0016c84a4c7654308f9 -> HofiOne/backport/logmsg-check-program

--- 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
     )
 )

Signed-off-by: shifter <shifter@axoflow.com>
Signed-off-by: Hofi <hofione@gmail.com>
Signed-off-by: shifter <shifter@axoflow.com>
Signed-off-by: Hofi <hofione@gmail.com>
@HofiOne HofiOne force-pushed the backport/logmsg-check-program branch from 74e9ffe to be33d4b Compare March 17, 2025 10:42
@HofiOne HofiOne changed the title Backport/logmsg check program Check program name for rfc3164 Mar 17, 2025
@HofiOne HofiOne merged commit a125e7c into syslog-ng:develop Mar 20, 2025
28 checks passed
@HofiOne HofiOne deleted the backport/logmsg-check-program branch March 20, 2025 09:48
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