Skip to content

Set transport macro for local mechanisms#4777

Merged
MrAnno merged 14 commits intosyslog-ng:masterfrom
bazsi:set-transport-macro-for-local-mechanisms
Jan 31, 2024
Merged

Set transport macro for local mechanisms#4777
MrAnno merged 14 commits intosyslog-ng:masterfrom
bazsi:set-transport-macro-for-local-mechanisms

Conversation

@bazsi
Copy link
Collaborator

@bazsi bazsi commented Jan 8, 2024

This rounds up the setting of the $TRANSPORT macro for local log transport mechanisms.

The convention used is: local+

  • local+unix-stream, local+unix-dgram
  • local+file
  • local+pipe
  • local+program
  • local+devkmsg
  • local+journal
  • local+afstreams
  • local+openbsd

+1 mqtt now sets $TRANSPORT to mqtt

@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the set-transport-macro-for-local-mechanisms branch from f4037e4 to 96e3c62 Compare January 16, 2024 12:07
@bazsi
Copy link
Collaborator Author

bazsi commented Jan 16, 2024

@mbonsack can you have a look on these transport values? I don't think we would see these too much, but I wanted to make sure that $TRANSPORT points to the ingest mechanism even if a local transport is used. Thanks

@bazsi bazsi mentioned this pull request Jan 17, 2024
bazsi added 8 commits January 17, 2024 13:48
The affile plugin implements file(), pipe(), stdin() and stdout() drivers.
Make sure all of the source drivers set $TRANSPORT properly.

Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the set-transport-macro-for-local-mechanisms branch from 96e3c62 to 0f01f71 Compare January 17, 2024 12:55
@bazsi
Copy link
Collaborator Author

bazsi commented Jan 17, 2024

@HofiOne I added code to set $TRANSPORT in the case for both darwin-oslog() and darwin-oslog-stream()

a review on that piece would be welcome.

Copy link
Collaborator

@HofiOne HofiOne left a comment

Choose a reason for hiding this comment

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

lgtm

bazsi added 6 commits January 18, 2024 20:38
Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the set-transport-macro-for-local-mechanisms branch from 0f01f71 to ccca5c1 Compare January 18, 2024 19:38
Copy link
Collaborator

@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.

static inline void
log_msg_set_value_to_string(LogMessage *self, NVHandle handle, const gchar *literal_string)
{
log_msg_set_value(self, handle, literal_string, strlen(literal_string));
Copy link
Collaborator

Choose a reason for hiding this comment

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

We call this on the hot path, for every message, when setting the $TRANSPORT macro.
I think it could be better if we'd call log_msg_set_value() with sizeof() or introduce log_msg_set_value_to_literal_string as a macro to avoid this per-message strlen() call.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@MrAnno MrAnno merged commit e8724ea into syslog-ng:master Jan 31, 2024
alltilla added a commit to alltilla/syslog-ng that referenced this pull request Feb 12, 2024
Signed-off-by: Attila Szakacs <[email protected]>
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.

4 participants