Skip to content

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Oct 15, 2023

This branch implements two new name-value pairs populated by syslog-ng to make it easier to create drill-downs into the message streams via metrics.

$TRANSPORT:

This branch implements $TRANSPORT, a new key-value pair, automatically populated by syslog-ng to indicate the kind of transport that was used to receive the message.

The $TRANSPORT is a higher level protocol, at least compared to $PROTO (contains the L3 protocol id from /etc/protocols) or $IP_PROTO

$IP_PROTO:
$IP_PROTO contains 4 for ipv4 and 6 for ipv6.

These are the current values from the afsocket module:

  • rfc3164+tls
  • rfc3164+tcp
  • rfc3164+udp
  • rfc3164+proxied-tls
  • rfc3164+<custom logproto like altp>
  • rfc5426: new style syslog over udp
  • rfc5425: new style syslog over tls
  • rfc6587: new style syslog over tcp
  • rfc5424+<custom logproto like altp>: new style syslog over a logproto plugin
  • unix-stream
  • unix-dgram

I have also added support for this to:

  • otel source (uses "otlp")
  • mqtt source (uses "mqtt")
  • hypr source (uses "hypr-api")

The branch also contains a couple of "other" patches:

  • a small refactor to define "predefined" name-value pairs that are not static in NVTable
  • a fix for an uninitialized value in transport-aux-data
  • the $PROTO value for transport(tls) connections is now "6"(tcp)
  • v4-mapped addresses in IPv6 sources should be translated to simple IPv4 addresses, instead of their more complex v4-mapped syntax (e.g. 192.168.1.1 instead of ::ffff:192.168.1.1)
  • inline documentation for the explicit source side batching feature in Python

Some of these could be extracted, others we are depending on with the new features.

@bazsi bazsi force-pushed the add-transport-value branch from 54ef805 to a10cc3b Compare October 15, 2023 18:43
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the add-transport-value branch from a10cc3b to 361aee1 Compare October 16, 2023 08:33
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi
Copy link
Collaborator Author

bazsi commented Oct 16, 2023

I dropped the patch that causes MacOS builds to build and added it to #4674

@bazsi bazsi force-pushed the add-transport-value branch from fbe2ce3 to 67b5083 Compare October 16, 2023 12:23
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi bazsi force-pushed the add-transport-value branch from 67b5083 to 3bf5184 Compare October 19, 2023 08:05
@kira-syslogng
Copy link
Contributor

Build FAILURE

bazsi added 16 commits October 20, 2023 10:06
Add the possibility of adding a set of LM_V_XXXX handles that are allocated
at startup but not "static" in the sense that they are stored in the
NVTable as normal dynamic name-value pairs.

This mechanism replaces LOG_MSG_GET_VALUE_HANDLE_STATIC() macro and
is easier to read and avoids races.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…ndle

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…Source

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@bazsi bazsi force-pushed the add-transport-value branch from 3bf5184 to 274807c Compare October 20, 2023 08:07
@bazsi
Copy link
Collaborator Author

bazsi commented Oct 20, 2023

Found the reason for the @kira-syslogng breakage. Let's hope it works out this time.

V4-mapped address space is a compatibility feature of dual-stack TCP/IP
stacks, where IPv4 connections can be established to IPv6 capable sockets.

When this happens, the client IP address would be a V4-mapped address,
as determined by the IN6_IS_ADDR_V4MAPPED() function, which
is equivalent to an "::FFFF:<ipv4>" address (see RFC3493)

This change would trickle into how we fill $HOST if we didn't find a
hostname there, previously these would have the form of "::FFFF:ipv4",
with this one they would become "ipv4" just as if we received them using
an ipv4 specific source.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@kira-syslogng
Copy link
Contributor

Build FAILURE

@bazsi
Copy link
Collaborator Author

bazsi commented Oct 30, 2023

@kira-syslogng retest this please;

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