syslog-ng-otlp() source options
This section describes the options of the syslog-ng-otlp() source in syslog-ng OSE.
The following options are available for the syslog-ng-otlp() source.
auth()
The auth() option can be used to set the authentication of the driver. The default state of this option is insecure, as it is not defined.
The following sub-options are available for auth().
adc()
This option is an authentication method that is only available for destinations. For more information, see Application Default Credentials.
alts()
This option is an accessible authentication available for Google infrastructures. Service accounts can be listed with the nested target-service-account() option, to match these against the server.
Example: configure an syslog-ng-otlp() source using auth(alts())
source {
syslog-ng-otlp(
port(4317)
auth(alts())
);
};
insecure()
This option can be used to disable authentication: auth(insecure()).
tls()
The tls() option accepts the following nested sub-options.
- ca-file()
- key-file()
- cert-file()
- peer-verify()
- required-trusted
- required-untrusted
- optional-trusted
- optional-untrusted
Example: configure an syslog-ng-otlp() source using auth(tls())
destination {
syslog-ng-otlp(
url("your-otel-server:12346")
auth(
tls(
ca-file("/path/to/ca.pem")
key-file("/path/to/key.pem")
cert-file("/path/to/cert.pem")
)
)
);
};
chain-hostname()
| Type: | yes, no |
| Default: | no |
Description: This option can be used to enable or disable the chained hostname format. For more information, see the chain-hostnames() global option.
channel-args()
| Type: | |
| Default: |
Description: The channel-args() option is available in gRPC-based drivers. The option accepts name-value pairs and sets channel arguments defined in the GRPC Core library documentation.
Example: channel-args() declaration
channel-args(
"grpc.loadreporting" => 1
"grpc.minimal_stack" => 0
)
concurrent-requests()
| Type: | integer |
| Default: | 2 |
Description: This option configures the upper limit of in-flight gRPC requests per worker. It is advised to set this value in the range of 10s or 100s when there are a high number of clients sending simultaneously. In an optimized solution, the number of workers() and concurrent-requests() is greater than or equal to the number of clients. However, this can cause an increase in memory usage.
default-facility()
| Type: | facility string |
| Default: | kern |
Description: This parameter assigns a facility value to the messages received from the syslog-ng-otlp source if the message does not specify one.
default-level()
This is just an alias of default-priority().
default-priority()
| Type: | priority string |
| Default: | notice |
Description: This option defines the default level value if the PRIORITY entry does not exist in the msg received from the syslog-ng-otlp source.
For example, default-priority(warning).
default-severity()
This is just an alias of default-priority().
dns-cache()
| Type: | yes, no |
| Default: | no |
Description: This option enables or disables the DNS cache usage.
ebpf()
| Type: | string |
| Default: | None |
This option is available in syslog-ng OSE 4.2 and later versions.
Description: By default, the kernel selects the receive socket for a specific UDP randomly based on the source IP/port of the sender. You can customize this algorithm using the Extended Berkeley Packet Filter (eBPF) plugin. The ebpf() option changes the kernel’s SO_REUSEPORT algorithm so that all messages are randomly placed into one of the UDP sockets. The decision which UDP socket buffer a datagram is placed is made for every datagram, and not once for every stream. This means that messages are perfectly load-balanced across your set of UDP sockets. While this resolves the imbalance between the sockets and results in perfect load balancing, you will lose ordering between messages from the same sender, which is the price to pay for increased throughput.
Example: Configure a syslog-ng-otlp() source with ebpf()
source {
syslog-ng-otlp(
udp(so-reuseport(yes) port(2000) persist-name("udp1")
ebpf(reuseport(sockets(4))));
udp(so-reuseport(yes) port(2000) persist-name("udp2"));
udp(so-reuseport(yes) port(2000) persist-name("udp3"));
udp(so-reuseport(yes) port(2000) persist-name("udp4"));
);
};
flags()
| Type: | assume-utf8, empty-lines, expect-hostname, kernel, no-hostname, no-multi-line, no-parse, sanitize-utf8, store-legacy-msghdr, store-raw-message, syslog-protocol, validate-utf8 |
| Default: | empty set |
Description: This option specifies the log parsing option of the source. The following flags are available:
assume-utf8: This flag expects UTF-8 encoded incoming messages, but does not verify the encoding. If the UTF-8 encoding of the incoming message must be validated, use thevalidate-utf8flag.empty-lines: Use the empty-lines flag to keep the empty lines of the messages. Otherwise, these lines are automatically removed.expect-hostname: When this flag is used syslog-ng OSE expects a log message that contains a hostname and parses the message accordingly. This is the default behavior for TCP sources. Note that pipe sources use theno-hostnameflag by default.guess-timezone: This flag allows the source to attempt to guess the timezone of the message if this information is not available in the message. Works when the incoming message stream is close to real time, and the timezone information is missing from the timestamp.kernel: This flag sets the source default to theLOG_KERN | LOG_NOTICEpriority if not specified otherwise.no-header: This flag triggers syslog-ng OSE to parse only thePRIfield of incoming messages, and put the rest of the message contents intoMSG. The functionality ofno-headeris similar to theno-parseflag, but theno-headerflag does not skip thePRIfield. Theno-headerflag signals syslog-ng OSE that the syslog header is not present (or does not adhere to the conventions / RFCs), so the entire message (except from thePRIfield) is put intoMSG.
parser p_syslog {
syslog-parser(
flags(no-header)
);
};
no-hostname: Enable this flag if the log message does not include the hostname of the sender host. This results in syslog-ng OSE assuming that the first part of the message header isPROGRAMinstead ofHOST.source s_dell { network( port(2000) flags(no-hostname) ); };no-multi-line: This flag disables line-breaking in the messages and converts the entire message into a single line. Note that this happens only if the underlying transport method supports multi-line messages. Currently only thefile()andpipe()drivers support multi-line messages.no-parse: By default, syslog-ng OSE parses incoming messages as syslog messages. Theno-parseflag disables syslog message parsing and processes the complete line as the message part of a syslog message. The syslog-ng OSE application generates a new syslog header (timestamp, host, and so on) automatically and puts the entire incoming message into theMESSAGEpart of the syslog message (available using the ${MESSAGE} macro). This flag is useful for parsing messages that do not complying to the syslog format.dont-store-legacy-msghdr: During default operation, syslog-ng OSE stores the original incoming header of the log message. This is useful if the original format of a non-syslog-compliant message must be retained. The syslog-ng OSE application automatically corrects minor header errors, for example, it adds a whitespace before “msg” in the following message:Jan 22 10:06:11 host program:msg. If storage of the original header of the message is not needed, enable thedont-store-legacy-msghdrflag.sanitize-utf8: When this flag is used, syslog-ng OSE converts non-UTF-8 input to an escaped format, adhering to UTF-8. Prior to version 4.6, this only worked with parsing RFC3164 messages. In syslog-ng OSE 4.6 and later versions, RFC5424 and raw messages can also be parsed using this flag.store-raw-message: This flag saves the original message as received from the client in the${RAWMSG}macro. This raw message can be forwarded in its original form to another syslog-ng OSE node using thesyslog-ng()destination, or to a SIEM system, making sure that the SIEM can process it. This flag is available in syslog-ng OSE 3.16 and later versions.syslog-protocol: This flag specifies that incoming messages are expected to be formatted according to the new IETF syslog protocol standard (RFC5424), but without the frame header. Note that this flag is not needed for the syslog driver, which handles only messages that have a frame header.validate-utf8: This flag enables encoding-verification for messages. Prior to version 4.6, this only worked with parsing RFC3164 messages. In syslog-ng OSE 4.6 and later versions, RFC5424 and raw messages can also be parsed using this flag. In the case of RFC5424 formatted messages, if the byte order mark (BOM) character is missing, but the message is otherwise UTF-8 compliant, syslog-ng OSE automatically adds the BOM character to the message.
format()
| Synopsis: | format(string) |
| Default: | syslog |
Description: This option specifies the default message parsing format used by syslog-ng OSE.
Plugins can define their own format parsers; if a plugin does not provide one, the default syslog format parser is used.
You can also define and explicitly use a custom parser separately, for example, in Python. For more information, see syslog parser.
host-override()
| Type: | string |
| Default: |
Description: Replaces the HOST part of the message with the
parameter string.
internal()
Description: To collect warnings, errors and notices from syslog-ng OSE itself, include this source in one of your source statements.
Example format in configuration:
source s_local { internal(); };
For more details, see internal: Collecting internal messages.
keep-hostname()
The syslog-ng-otlp() and opentelemetry() sources ignore this option and use the hostname from the message as the ${HOST}.
keep-timestamp()
| Accepted values: | yes | no |
| Default: | yes |
Description: Specifies whether syslog-ng OSE should accept the timestamp received from the sending application or client. If disabled, the time of reception will be used instead. This option can be specified globally, and per-source as well. The local setting of the source overrides the global option if available.
CAUTION: To use the S_ macros,
the keep-timestamp() option must be enabled (this is the default behavior of syslog-ng OSE).
log-fetch-limit()
| Type: | number |
| Default: | 100 |
Description: The maximum number of messages fetched from a source during a single poll loop. The destination queues might fill up before flow-control could stop reading if log-fetch-limit() is too high.
log-iw-size()
| Type: | number |
| Default: | 100 |
Description: The size of the initial source window, this value is used during
flow-control, applies only if flow-control() is enabled.
Note that when using disk-buffer(), the messages stored on disk are not included in the window size calculation.
For details about flow-control and the effects of this parameter, see Managing incoming and outgoing messages with flow-control.
NOTE: If dynamic flow-control is disabled (which is the default behavior), the value of the log-iw-size() option cannot be lower than 100. If dynamic flow-control is enabled, you can decrease the value of the log-iw-size() option (to the minimum of 1).
Make sure that log-iw-size() is larger than the value of log-fetch-limit().
When the max-connections() option is configured, log-iw-size() is split among the active connections (except for UDP-based connections). If max-connections() is not set, log-iw-size() is divided by 10, which is the default max-connections() value. The calculated value becomes the initial window size for each connection.
For best performance when receiving logs from syslog-ng OSE clients, ensure that this window size exceeds the flush-lines() value configured on the client destinations.
CAUTION:
Changing the value of log-iw-size() while keep-alive() is enabled affects only newly established connections; existing keep-alive connections will continue using the previous log-iw-size() value. To apply the new log-iw-size() setting to all connections, you must restart the syslog-ng service — a simple configuration reload is NOT sufficient.
If the source receives data over the UDP protocol, always restart the syslog-ng service after modifying the log-iw-size() value for the changes to take effect.
log-prefix()
NOTE: The deprecated log-prefix() option is an alias for the program-override() option, retained for compatibility with earlier syslog-ng OSE versions, but it may be removed at any time without further notice!
normalize-hostnames()
| Type: | yes, no |
| Default: | no |
Description: If this option is set to yes (normalize-hostnames(yes)), syslog-ng OSE converts the hostnames to lowercase. This setting only applies to hostnames resolved from DNS. It has no effect if the keep-hostname() option is enabled, and the message contains a hostname.
| Accepted values: | yes | no|
|Default: |no|
NOTE: This setting applies only to hostnames resolved from DNS. It has no effect if the keep-hostname() option is enabled, and the message contains a hostname.
persist-name()
| Type: | string |
| Default: | N/A |
Description: If you receive the following error message during syslog-ng OSE startup, set the persist-name() option of the duplicate drivers:
Error checking the uniqueness of the persist names, please override it with persist-name option. Shutting down.
or
Automatic assignment of persist names failed, as conflicting persist names were found. Please override the automatically assigned identifier using an explicit persist-name() option or remove the duplicated configuration elements.
This error happens if you use identical drivers in multiple sources, for example, if you configure two file sources to read from the same file. In this case, set the persist-name() of the drivers to a custom string, for example, persist-name(“example-persist-name1”).
port()
| Type: | number |
| Default: |
Description: The port number of the .
program-override()
| Type: | string |
| Default: |
Description: Replaces the ${PROGRAM} part of the message with the parameter string. For example, to mark every message coming from the kernel, include the program-override("kernel") option in the source containing /proc/kmsg.
sdata-prefix()
| Type: | string |
| Default: | .SDATA. |
Available in syslog-ng OSE 4.1 and later versions.
Description: Adds a specific string before the names of the parsed SDATA fields to store the name-value pairs created from the SDATA fields separately. Note that unless the value of sdata-prefix starts with .SDATA., using this option excludes the parsed fields from the sdata and rfc5424 scopes of the value pairs.
tags()
| Type: | string |
| Default: |
Description: Label the messages received from the source with custom tags. Tags must be unique, and enclosed between double quotes. When adding multiple tags, separate them with comma, for example, tags(“dmz”, “router”). This option is available only in syslog-ng OSE 3.1 and later.
time-zone()
| Type: | name of the timezone, or the timezone offset |
| Default: |
Description: The default timezone for messages read from the source. Applies only if no timezone is specified within the message itself.
The timezone can be specified by using the name, for example, time-zone(“Europe/Budapest”)), or as the timezone offset in +/-HH:MM format, for example, +01:00). On Linux and UNIX platforms, the valid timezone names are listed under the /usr/share/zoneinfo directory.
time-reopen()
| Accepted values: | number [seconds] |
| Default: | 60 |
Description: The time to wait in seconds before a dead connection is reestablished.
use-dns()
| Accepted values: | yes, no, persist_only |
| Default: | yes |
Description: Enable or disable DNS usage. The persist_only option attempts to resolve hostnames locally from file (for example, from /etc/hosts). The syslog-ng OSE application blocks on DNS queries, so enabling DNS may lead to a Denial of Service attack. To prevent DoS, protect your syslog-ng OSE network endpoint with firewall rules, and make sure that all hosts which may get to syslog-ng OSE are resolvable. This option can be specified globally, and per-source as well. The local setting of the source overrides the global option if available.
NOTE: This option has no effect if the keep-hostname() option is enabled (keep-hostname(yes)) and the message contains a hostname.
use-fqdn()
| Accepted values: | yes | no |
| Default: | no |
Description: Use this option to add a Fully Qualified Domain Name (FQDN) instead of a short hostname. You can specify this option either globally or per-source. The local setting of the source overrides the global option if available.
TIP: Set use-fqdn() to yes if you want to use the custom-domain() global option.
NOTE: This option has no effect if the keep-hostname() option is enabled (keep-hostname(yes)) and the message contains a hostname.
workers()
| Type: | integer |
| Default: | 1 |
Description: Specifies the number of worker threads (at least 1) that syslog-ng OSE uses to send messages to the server. Increasing the number of worker threads can drastically improve the performance of the destination.
CAUTION:
Hazard of data loss! When you use more than one worker threads together with disk-based buffering, syslog-ng OSE creates a separate disk buffer for each worker thread. This means that decreasing the number of workers can result in losing data currently stored in the disk buffer files. Do not decrease the number of workers when the disk buffer files are in use.
If you are using load-balancing (that is, you have configured multiple servers in the url() option), increase the number of worker threads at least to the number of servers. For example, if you have set three URLs (url(“site1”, “site2”, “site3”)), set the workers() option to 3 or more.
use-syslogng-pid()
| Accepted values: | yes, no |
| Default: | no |
Description: If this parameter is set to yes, syslog-ng OSE fills the value of the ${PID} macro with its own process ID.