clickhouse() destination options
This section describes the options of the clickhouse() destination in syslog-ng OSE.
The clickhouse() destination has the following options:
auth()
You can set authentication in the auth() option of the driver. By default, authentication is disabled (auth(insecure())).
The following authentication methods are available in the auth() block:
adc()
Application Default Credentials (ADC). This authentication method is only available for destinations.
service-account-key()
Available in { site.product.short_name }} version 4.15 and later.
Use the specified service account key for ADC authentication. File path must be the absolute path. For example:
auth(adc(service-account-key("absolute-path-to-key-file")))
alts()
Application Layer Transport Security (ALTS) is a simple to use authentication, only available within Google’s infrastructure. It accepts the target-service-account() option, where you can list service accounts to match against when authenticating the server.
destination {
clickhouse(
port(12345)
auth(alts())
);
};
insecure()
This is the default method, authentication is disabled (auth(insecure())).
tls()
tls() accepts the key-file(), cert-file(), ca-file() and peer-verify() (possible values: required-trusted, required-untrusted, optional-trusted and optional-untrusted) options.
destination {
clickhouse(
url("your-clickhouse-server:12346")
auth(
tls(
ca-file("/path/to/ca.pem")
key-file("/path/to/key.pem")
cert-file("/path/to/cert.pem")
)
)
);
};
batch-bytes()
| Accepted values: | number [bytes] |
| Default: | none |
Description: Sets the maximum size of payload in a batch. If the size of the messages reaches this value, syslog-ng OSE sends the batch to the destination even if the number of messages is less than the value of the batch-lines() option.
Note that if the batch-timeout() option is enabled and the queue becomes empty, syslog-ng OSE flushes the messages only if batch-timeout() expires, or the batch reaches the limit set in batch-bytes().
Available in syslog-ng OSE version 3.19 and later.
batch-lines()
| Type: | number |
| Default: | 1 |
Description: Specifies how many lines are flushed to a destination in one batch. The syslog-ng OSE application waits for this number of lines to accumulate and sends them off in a single batch. Increasing this number increases throughput as more messages are sent in a single batch, but also increases message latency.
For example, if you set batch-lines() to 100, syslog-ng OSE waits for 100 messages.
If the batch-timeout() option is disabled, the syslog-ng OSE application flushes the messages if it has sent batch-lines() number of messages, or the queue became empty. If you stop or reload syslog-ng OSE or in case of network sources, the connection with the client is closed, syslog-ng OSE automatically sends the unsent messages to the destination.
Note that if the batch-timeout() option is enabled and the queue becomes empty, syslog-ng OSE flushes the messages only if batch-timeout() expires, or the batch reaches the limit set in batch-lines().
For optimal performance, make sure that the syslog-ng OSE source that feeds messages to this destination is configured properly: the value of the log-iw-size() option of the source must be higher than the batch-lines()*workers() of the destination. Otherwise, the size of the batches cannot reach the batch-lines() limit.
batch-timeout()
| Type: | time in milliseconds |
| Default: | -1 (disabled) |
Description: Specifies the time syslog-ng OSE waits for lines to accumulate in the output buffer. The syslog-ng OSE application sends batches to the destinations evenly. The timer starts when the first message arrives to the buffer, so if only few messages arrive, syslog-ng OSE sends messages to the destination at most once every batch-timeout() milliseconds.
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
)
compression()
| Type: | boolean |
| Default: | no |
Available in syslog-ng OSE 4.5 and later versions.
Description: This option enables compression in gRPC requests. Currently only deflate-type (similar to gzip) compression is supported.
cloud-auth()
Description: Configures the cloud authentication module for gRPC- and HTTP-based destinations, enabling OAuth2 authentication using the syslog-ng OSE cloud authentication framework.
The following authentication methods are available:
azure()
The azure() option supports the following parameters:
app_idapp_secretmonitortenant_id
gcp()
The gcp() option supports the following parameters:
service_accountaudiencekeyscopetoken_validity_duration
user_managed_service_accountmetadata_urlname
oauth2()
Configures OAuth2 authentication for gRPC-based and http destinations. Tokens are automatically injected into gRPC metadata and HTTP headers for each request.
The oauth2() option supports the following parameters:
client_idclient_secrettoken_urlscopeauth_methodbasicpost_body
authorization_detailsrefresh_offsetresource
dataset()
| Type: | string |
| Default: |
Description: The name of the syslog-ng OSE destination dataset.
disk-buffer()
Description: This option enables putting outgoing messages into the disk buffer of the destination to avoid message loss in case of a system failure on the destination side. It has the following suboptions:
capacity-bytes()
| Type: | number (bytes) |
| Default: | 1 MiB |
Description: This is a required option. The maximum size of the disk-buffer in bytes. The minimum value is 1048576 bytes. If you set a smaller value, the minimum value will be used automatically. It replaces the old log-disk-fifo-size() option.
In syslog-ng OSE version 4.2 and earlier, this option was called disk-buf-size().
compaction()
| Type: | yes/no |
| Default: | no |
Description: If set to yes, syslog-ng OSE prunes the unused space in the LogMessage representation, making the disk queue size smaller at the cost of some CPU time. Setting the compaction() argument to yes is recommended when numerous name-value pairs are unset during processing, or when the same names are set multiple times.
NOTE: Simply unsetting these name-value pairs by using the unset() rewrite operation is not enough, as due to performance reasons that help when syslog-ng OSE is CPU bound, the internal representation of a LogMessage will not release the memory associated with these name-value pairs. In some cases, however, the size of this overhead becomes significant (the raw message size can grow up to four times its original size), which unnecessarily increases the disk queue file size. For these cases, the compaction will drop unset values, making the LogMessage representation smaller at the cost of some CPU time required to perform compaction.
dir()
| Type: | string |
| Default: | N/A |
Description: Defines the folder where the disk-buffer files are stored.
CAUTION: When creating a new dir() option for a disk buffer, or modifying an existing one, make sure you delete the persist file.
syslog-ng OSE creates disk-buffer files based on the path recorded in the persist file. Therefore, if the persist file is not deleted after modifying the dir() option, then following a restart, syslog-ng OSE will look for or create disk-buffer files in their old location. To ensure that syslog-ng OSE uses the new dir() setting, the persist file must not contain any information about the destinations which the disk-buffer file in question belongs to.
flow-control-window-bytes()
| Type: | number (bytes) |
| Default: | 163840000 |
Description: Use this option if the option reliable() is set to yes. This option contains the size of the messages in bytes that is used in the memory part of the disk buffer. It replaces the old log-fifo-size() option. It does not inherit the value of the global log-fifo-size() option, even if it is provided. Note that this option will be ignored if the option reliable() is set to no.
In syslog-ng OSE version 4.2 and earlier, this option was called mem-buf-size().
flow-control-window-size()
| Type: | number(messages) |
| Default: | 10000 |
Description: Use this option if the option reliable() is set to no. This option contains the number of messages stored in overflow queue. It replaces the old log-fifo-size() option. It inherits the value of the global log-fifo-size() option if provided. If it is not provided, the default value is 10000 messages. Note that this option will be ignored if the option reliable() is set to yes.
In syslog-ng OSE version 4.2 and earlier, this option was called mem-buf-length().
front-cache-size()
| Type: | number(messages) |
| Default: | 1000 |
Description: The number of messages stored in the output buffer of the destination. Note that if you change the value of this option and the disk-buffer already exists, the change will take effect when the disk-buffer becomes empty.
Options reliable() and capacity-bytes() are required options.
In syslog-ng OSE version 4.2 and earlier, this option was called qout-size().
prealloc()
| Type: | yes/no |
| Default: | no |
Description: By default, syslog-ng OSE doesn’t reserve the disk space for the disk-buffer file, since in a properly configured and sized environment the disk-buffer is practically empty, so a large preallocated disk-buffer file is just a waste of disk space. But a preallocated buffer can prevent other data from using the intended buffer space (and elicit a warning from the OS if disk space is low), preventing message loss if the buffer is actually needed. To avoid this problem, when using syslog-ng OSE 4.0 or later, you can preallocate the space for your disk-buffer files by setting prealloc(yes).
In addition to making sure that the required disk space is available when needed, preallocated disk-buffer files provide radically better (3-4x) performance as well: in case of an outage the amount of messages stored in the disk-buffer is continuously growing, and using large continuous files is faster, than constantly waiting on a file to change its size.
If you are running syslog-ng OSE on a dedicated host (always recommended for any high-volume settings), use prealloc(yes).
Available in syslog-ng OSE 4.0 and later.
reliable()
| Type: | yes/no |
| Default: | no |
Description: If set to yes, syslog-ng OSE cannot lose logs in case of reload/restart, unreachable destination or syslog-ng OSE crash. This solution provides a slower, but reliable disk-buffer option. It is created and initialized at startup and gradually grows as new messages arrive. If set to no, the normal disk-buffer will be used. This provides a faster, but less reliable disk-buffer option.
CAUTION: Hazard of data loss! If you change the value of reliable() option when there are messages in the disk-buffer, the messages stored in the disk-buffer will be lost.
truncate-size-ratio()
| Type: | number((between 0 and 1)) |
| Default: | 1 (do not truncate) |
Description: Limits the truncation of the disk-buffer file. Truncating the disk-buffer file can slow down the disk IO operations, but it saves disk space. By default, syslog-ng OSE version 4.0 and later doesn’t truncate disk-buffer files by default (truncate-size-ratio(1)). Earlier versions freed the disk-space when at least 10% of the disk-buffer file could be freed (truncate-size-ratio(0.1)).
syslog-ng OSE only truncates the file if the possible disk gain is more than truncate-size-ratio() times capacity-bytes().
- Smaller values free disk space quicker.
- Larger ratios result in better performance.
If you want to avoid performance fluctuations:
- use truncate-size-ratio(1) (never truncate), or
- use prealloc(yes) to reserve the entire size of the disk-buffer on disk.
CAUTION: It is not recommended to change truncate-size-ratio(). Only change its value if you understand the performance implications of doing so.
Example: Examples for using disk-buffer()
In the following case reliable disk-buffer() is used.
destination d_demo {
network(
"127.0.0.1"
port(3333)
disk-buffer(
flow-control-window-bytes(10000)
capacity-bytes(2000000)
reliable(yes)
dir("/tmp/disk-buffer")
)
);
};
In the following case normal disk-buffer() is used.
destination d_demo {
network(
"127.0.0.1"
port(3333)
disk-buffer(
flow-control-window-size(10000)
capacity-bytes(2000000)
reliable(no)
dir("/tmp/disk-buffer")
)
);
};
format()
| Type: | JSONEachRow, JSONCompactEachRow, or Protobuf |
| Default: | see description |
Available in syslog-ng OSE 4.20 and later versions.
Description: Specifies the data format to use when sending data to Clickhouse.
By default, format() is set to:
Protobufif theproto-var()option is set, orJSONEachRowif thejson-var()option is set.
Starting with syslog-ng OSE 4.20, you can also use format(JSONCompactEachRow) (when json-var() is also set) to use a more compact, array-based JSON representation. For example:
destination {
clickhouse (
# ...
json-var(json("$my_filterx_json_variable"))
format("JSONCompactEachRow")
# ...
);
};
In the JSONEachRow format each line is a JSON object, making it more readable. For example:
{"id":1,"name":"foo","value":42}
{"id":2,"name":"bar","value":17}
In the JSONCompactEachRow format each row is a compact array-based row:
[1,"foo",42]
[2,"bar",17]
Note that if the data’s actual format does not match the selected format, ClickHouse returns a CANNOT_PARSE_INPUT_ASSERTION_FAILED error message.
frac-digits()
| Type: | number |
| Default: | 0 |
Description: The syslog-ng OSE application can store fractions of a second in the timestamps according to the ISO8601 format. The frac-digits() parameter specifies the number of digits stored. The digits storing the fractions are padded by zeros if the original timestamp of the message specifies only seconds. Fractions can always be stored for the time the message was received.
NOTE: The syslog-ng OSE application can add the fractions to non-ISO8601 timestamps as well.
NOTE: As syslog-ng OSE is precise up to the microsecond, when the frac-digits() option is set to a value higher than 6, syslog-ng OSE will truncate the fraction seconds in the timestamps after 6 digits.
headers()
| Type: | arrow list |
| Default: | empty |
Available in syslog-ng OSE 4.8 and later versions.
Description: Adds custom gRPC headers to each RPC call. Currently only static header names and values are supported.
headers(
"organization" => "org-name"
"stream-name" => "org-stream"
)
Copyright © 2024 Axoflow
hook-commands()
Description: This option makes it possible to execute external programs when the relevant driver is initialized or torn down. The hook-commands() can be used with all source and destination drivers with the exception of the usertty() and internal() drivers.
NOTE: The syslog-ng OSE application must be able to start and restart the external program, and have the necessary permissions to do so. For example, if your host is running AppArmor or SELinux, you might have to modify your AppArmor or SELinux configuration to enable syslog-ng OSE to execute external applications.
Using the hook-commands() when syslog-ng OSE starts or stops
To execute an external program when syslog-ng OSE starts or stops, use the following options:
startup()
| Type: | string |
| Default: | N/A |
Description: Defines the external program that is executed as syslog-ng OSE starts.
shutdown()
| Type: | string |
| Default: | N/A |
Description: Defines the external program that is executed as syslog-ng OSE stops.
Using the hook-commands() when syslog-ng OSE reloads
To execute an external program when the syslog-ng OSE configuration is initiated or torn down, for example, on startup/shutdown or during a syslog-ng OSE reload, use the following options:
setup()
| Type: | string |
| Default: | N/A |
Description: Defines an external program that is executed when the syslog-ng OSE configuration is initiated, for example, on startup or during a syslog-ng OSE reload.
teardown()
| Type: | string |
| Default: | N/A |
Description: Defines an external program that is executed when the syslog-ng OSE configuration is stopped or torn down, for example, on shutdown or during a syslog-ng OSE reload.
Example: Using the hook-commands() with a network source
In the following example, the hook-commands() is used with the network() driver and it opens an iptables port automatically as syslog-ng OSE is started/stopped.
The assumption in this example is that the LOGCHAIN chain is part of a larger ruleset that routes traffic to it. Whenever the syslog-ng OSE created rule is there, packets can flow, otherwise the port is closed.
source {
network(transport(udp)
hook-commands(
startup("iptables -I LOGCHAIN 1 -p udp --dport 514 -j ACCEPT")
shutdown("iptables -D LOGCHAIN 1")
)
);
};
json-var()
| Type: | string |
| Default: |
Available in syslog-ng OSE 4.20 and later versions.
Description: The json-var() option accepts either a JSON template or a variable containing a JSON string, and sends it to the ClickHouse server in Protobuf/JSON mixed mode (JSONEachRow format). In this mode, type validation is performed by the ClickHouse server itself, so no Protobuf schema is required for communication. For example:
destination {
clickhouse (
...
json-var(json("{\"ingest_time\":1755248921000000000, \"body\": \"test template\"}"))ß
};
};
Using json-var() is mutually exclusive with the proto-var(), server-side-schema(), schema(), and protobuf-schema() options.
keep-alive()
| Type: | yes or no |
| Default: | yes |
Description: Specifies whether connections to sources should be closed when syslog-ng OSE is forced to reload its configuration (upon the receipt of a SIGHUP signal). Note that this applies to the server (source) side of the syslog-ng OSE connections, client-side (destination) connections are always reopened after receiving a HUP signal unless the keep-alive option is enabled for the destination.
local-time-zone()
| Type: | name of the timezone, or the timezone offset |
| Default: | The local timezone. |
Description: Sets the timezone used when expanding filename and tablename templates.
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.
log-fifo-size()
| Type: | number |
| Default: | Use global setting. |
Description: The number of messages that the output queue can store.
on-error()
| Accepted values: | drop-message | drop-property | fallback-to-string | silently-drop-message | silently-drop-property | silently-fallback-to-string |
| Default: | Use the global setting (which defaults to drop-message) |
Description: Controls what happens when type-casting fails and syslog-ng OSE cannot convert some data to the specified type. By default, syslog-ng OSE drops the entire message and logs the error. Currently the value-pairs() option uses the settings of on-error().
-
drop-message: Drop the entire message and log an error message to the internal() source. This is the default behavior of syslog-ng OSE.
-
drop-property: Omit the affected property (macro, template, or internal() source. message-field) from the log message and log an error message to the
-
fallback-to-string: Convert the property to string and log an error message to the internal() source.
-
silently-drop-message: Drop the entire message silently, without logging the error.
-
silently-drop-property: Omit the affected property (macro, template, or message-field) silently, without logging the error.
-
silently-fallback-to-string: Convert the property to string silently, without logging the error.
password()
| Type: | string |
| Default: | N/A |
Description: The password used to authenticate on the .
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”).
protobuf-schema()
| Type: | schema |
| Default: |
Description: Defines the schema syntax of the BigQuery table from a protobuf schema file.
protobuf-schema("/tmp/test.proto" => "${MESSAGE}", "${PROGRAM}", "${HOST}", "${PID}")
Example: using the protobuf-schema() option
syntax = "proto2";
message CustomRecord {
optional string message = 1;
optional string app = 2;
optional string host = 3;
optional int64 pid = 4;
}
proto-var()
| Type: | FilterX variable |
| Default: |
Available in syslog-ng OSE 4.13 and later versions.
Description: Create the message contents from a FilterX variable formatted using the protobuf_message function, instead of using schema() or protobuf-schema().
response-action()
| Type: | arrow list |
| Default: | driver dependent |
Available in syslog-ng OSE 4.13 and later versions.
Description: Fine-tunes how syslog-ng OSE behaves in case of different gRPC results. You can assign specific actions to the different gRPC results, for example:
response-action(
not-found => disconnect
unavailable => drop
)
The following gRPC results are supported:
abortedalready-existscancelleddata-lossdeadline-exceededfailed-preconditioninternalinvalid-argumentnot-foundokout-of-rangepermission-deniedresource-exhaustedunauthenticatedunavailableunknownunimplemented
The following actions are available:
disconnectdropretrysuccess
retries()
| Type: | number (of attempts) |
| Default: | 3 |
Description: If syslog-ng OSE cannot send a message, it will try again until the number of attempts reaches retries().
If the number of attempts reaches retries(), syslog-ng OSE will wait for time-reopen() time, then tries sending the message again.
schema()
| Type: | schema |
| Default: |
Description: Defines the schema syntax of the BigQuery table. Each line defines a column. The first part of the line defines the name and type of the column, the second part after the arrow sets syslog-ng OSE templates or macros which are evaluated on every log routed to the bigquery() destination. The available column types are the following: STRING, BYTES, INTEGER, FLOAT, BOOLEAN, TIMESTAMP, DATE, TIME, DATETIME, JSON, NUMERIC, BIGNUMERIC, GEOGRAPHY, RECORD, INTERVAL.
Example: defining a BigQuery table using schema()
schema(
"message" => "${MESSAGE}"
"app" STRING => "${PROGRAM}"
"host" STRING => "${HOST}"
"time" DATETIME => "${ISODATE}"
"pid" INTEGER => int("${PID}")
)
send-time-zone()
| Accepted values: | name of the timezone, or the timezone offset |
| Default: | local timezone |
Description: Specifies the time zone associated with the messages sent by syslog-ng OSE, if not specified otherwise in the message or in the destination driver.
For details, see also Timezones and daylight saving and A note on timezones and timestamps.
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.
server-side-schema()
| Type: | string |
| Default: |
Description: By default, sending data to ClickHouse does not propagate the type information of the data fields. The server-side-schema() option provides a solution for that using the ClickHouse format schema. Using a server-side schema is needed when you are using complex types, like DateTime or LowCardinality.
- Create a
.protofile that matches theschema()of your syslog-ng OSE configuration. For details on formatting, see the ClickHouse documentation. For example: ```config syntax = “proto3”;
message MessageType { uint32 user_id = 3; string message = 1; string timestamp = 2; float metric = 4; };
2. Copy the `.proto` file to your ClickHouse server, into the directory set in the proto_schema_path option of your ClickHouse configuration.
3. Reference that schema in the `clickhouse()` <a href="/admin-guide/200_About/002_Glossary#destination" class="nav-link content-tooltip">destination</a> of your <a href="/admin-guide/200_About/002_Glossary#syslog-ng-ose" class="nav-link content-tooltip">syslog-ng OSE</a> configuration. The parameter of `server-side-schema()` is <name-of-the-proto-file>:<identifier-after-message-in-the-proto-file>. So if in the previous step you named the proto file my-proto-file.proto with the sample content, the parameter will be `my-proto-file:MessageType`. For example:
```config
destination {
clickhouse(
database("default")
table("demo_table")
user("your-username")
password("your-password")
schema(
"user_id" UInt32 => $R_MSEC,
"message" String => "$MSG",
"timestamp" DateTime => "$R_UNIXTIME",
"metric" Float32 => 3.14
)
server-side-schema("<my_proto_file_on_server>:<my_message_schema_name>")
);
};
table()
| Type: | string |
| Default: |
Description: Defines the name of the Google BigQuery table where syslog-ng OSE send data to.
template-escape()
| Type: | yes or no |
| Default: | no |
Description: Turns on escaping for the ', ", and backspace characters in templated output files. This is useful for generating SQL statements and quoting string contents so that parts of the log message are not interpreted as commands to the SQL server.
NOTE: In syslog-ng OSE 4.5 and later versions template-escape(yes) escapes the top-level template function in case of nested template functions.
throttle()
| Type: | number |
| Default: | 0 |
Description: Sets the maximum number of messages sent to the destination per second. Use this output-rate-limiting functionality only when using disk-buffer as well to avoid the risk of losing messages. Specifying 0 or a lower value sets the output limit to unlimited.
time-reopen()
| Accepted values: | number [seconds] |
| Default: | 60 |
Description: The time to wait in seconds before a dead connection is reestablished.
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.
ts-format()
| Type: | rfc3164, bsd, rfc3339, iso |
| Default: | rfc3164 |
Description: Override the global timestamp format (set in the global ts-format() parameter) for the specific destination. For details, see ts-format().
NOTE: This option applies only to file and file-like destinations. Destinations that use specific protocols (for example, network(), or syslog()) ignore this option. For protocol-like destinations, use a template locally in the destination, or use the proto-template() option.
url()
| Type: | string |
| Default: | bigquerystorage.googleapis.com |
Description: This option sets the URL of the Google BigQuery where the logs are sent.
user()
| Type: | string |
| Default: |
Description: The username used for authentication.
worker-partition-autoscaling()
| Type: | yes, no |
| Default: | no |
Available in syslog-ng OSE 4.21 and later versions.
Description: When using worker-partition-key() to categorize messages into different batches, the messages are hashed into workers by default. This prevents distributing across workers based on load.
Setting worker-partition-autoscaling(yes) uses a 1-minute statistic to distribute high-traffic partitions among multiple workers, allowing each worker to maximize its batch size. When using worker-partition-autoscaling(yes), set the number of workers() to higher than the expected number of partitions.
worker-partition-buckets()
| Type: | template |
| Default: |
Description: The worker-partition-buckets() option determines the number of worker threads used for the worker-partition-key(). Note that the number set by worker-partition-buckets() should be lower than the number of workers().
worker-partition-key()
| Type: | template |
| Default: |
Description: This option specifies a template. Messages that expand the template to the same value are mapped to the same partition. If batching is enabled and multiple workers are configured, only add messages to a batch that generate identical URLs. To achieve this, set the worker-partition-key() option with a template that contains all the templates used in the url() option, otherwise messages get mixed.
Example: partitioning messages based on destination host
worker-partition-key("${HOST}")
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.
Copyright © 2025 Axoflow