Version
Only the PUT and the POST methods are supported.
HTTPS connection, as well as password- and certificate-based authentication is supported.
If the server returns a status code beginning with 2 (for example, 200), syslog-ng OSE assumes the message was successfully sent. For other response codes, see HTTP destination options. You can override the behavior of syslog-ng OSE using the response-action() option.
destination d_https { http( [...] tls( ca-file("/<path-to-certificate-directory>/ca-crt.pem") ca-dir("/<path-to-certificate-directory>/") cert-file("/<path-to-certificate-directory>/server-crt.pem") key-file("/<path-to-certificate-directory>/server-key.pem") ) [...] ); };
destination d_http { http( url("<web-service-IP-or-hostname>") method("<HTTP-method>") user-agent("<USER-AGENT-message-value>") user("<username>") password("<password>") ); };
You can use the proxy() option to configure the HTTP driver in all HTTP-based destinations to use a specific HTTP proxy that is independent from the proxy configured for the system.
Alternatively, you can leave the HTTP as-is, in which case the driver leaves the default http_proxy and https_proxy environment variables unmodified.
For more detailed information about these environment variables, see the libcurl documentation.
NOTE: Configuring the proxy() option overwrites the default http_proxy and https_proxy environment variables.
The following example defines an http destination.
destination d_http { http( url("http://127.0.0.1:8000") method("PUT") user-agent("syslog-ng User Agent") user("user") password("password") headers("HEADER1: header1", "HEADER2: header2") body("${ISODATE} ${MESSAGE}") ); }; log { source(s_file); destination(d_http); flags(flow-control); };
You can also use the http() destination to forward log messages to Splunk using syslog-ng OSE.
Starting with version
The batch-lines(), batch-lines(), and batch-timeout() options of the destination determine how many log messages syslog-ng OSE sends in a batch. The batch-lines() option determines the maximum number of messages syslog-ng OSE puts in a batch in. This can be limited based on size and time:
syslog-ng OSE sends a batch every batch-timeout() milliseconds, even if the number of messages in the batch is less than batch-lines(). That way the destination receives every message in a timely manner even if suddenly there are no more messages.
syslog-ng OSE sends the batch if the total size of the messages in the batch reaches batch-bytes() bytes.
To increase the performance of the destination, increase the number of worker threads for the destination using the workers() option, or adjust the batch-bytes(), batch-lines(), batch-timeout() options.
By default, syslog-ng OSE separates the log messages of the batch with a newline character. You can specify a different delimiter by using the delimiter() option.
If the target application or server requires a special beginning or ending to recognize batches, use the body-prefix() and body-suffix() options to add a beginning and ending to the batch. For example, you can use these options to create JSON-encoded arrays as POST payloads, which is required by a number of REST APIs. The body of a batch HTTP request looks like this:
value of body-prefix() option log-line-1 (as formatted in the body() option) log-line-2 (as formatted in the body() option) .... log-line-n (the number of log lines is batch-lines(), or less if batch-timeout() has elapsed or the batch would be longer than batch-bytes()) value of body-suffix() option
The following destination sends log messages to an Elasticsearch server using the bulk API. A batch consists of 100 messages, or a maximum of 512 kilobytes, and is sent every 10 seconds (10000 milliseconds).
destination d_http { http(url("http://your-elasticsearch-server/_bulk") method("POST") batch-lines(100) batch-bytes(512Kb) batch-timeout(10000) headers("Content-Type: application/x-ndjson") body-suffix("\n") body('{ "index":{} } $(format-json --scope rfc5424 --key ISODATE)') ); };
Starting with version
|
Caution:
If you set multiple URLs in the url() option, set the persist-name() option as well to avoid data loss. |
Starting with version syslog-ng OSE version
url("server1", "server2", "server3"); # comma-separated strings url("server1" "server2" "server3"); # space-separated strings url("server1 server2 server3"); # space-separated within a single string
The following destination sends log messages to an Elasticsearch server using the bulk API, to 3 different ingest nodes. Each node is assigned a separate worker thread. A batch consists of 100 messages, or a maximum of 512 kilobytes, and is sent every 10 seconds (10000 milliseconds).
destination d_http { http(url("http://your-elasticsearch-server/_bulk" "http://your-second-ingest-node/_bulk" "http://your-third-ingest-node/_bulk") method("POST") batch-lines(100) batch-bytes(512Kb) batch-timeout(10000) workers(3) headers("Content-Type: application/x-ndjson") body-suffix("\n") body('{ "index":{} } $(format-json --scope rfc5424 --key ISODATE)') persist-name("d_http-load-balance") ); };
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.
The http destination of syslog-ng OSE can directly post log messages to web services using the HTTP protocol. The http destination has the following options.
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
For details on how this option influences HTTP batch mode, see http: Posting messages over HTTP without Java
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.
For details on how this option influences HTTP batch mode, see http: Posting messages over HTTP without Java
Type: | time in milliseconds |
Default: | none |
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.
For details on how this option influences HTTP batch mode, see http: Posting messages over HTTP without Java
Type: | string or template |
Default: |
Description: The body of the HTTP request, for example, body("${ISODATE} ${MESSAGE}"). You can use strings, macros, and template functions in the body. If not set, it will contain the message received from the source by default.
Accepted values: | string |
Default: | none |
Description: The string syslog-ng OSE puts at the beginning of the body of the HTTP request, before the log message. Available in syslog-ng OSE version
For details on how this option influences HTTP batch mode, see http: Posting messages over HTTP without Java
Accepted values: | string |
Default: | none |
Description: The string syslog-ng OSE puts to the end of the body of the HTTP request, after the log message. Available in syslog-ng OSE version
For details on how this option influences HTTP batch mode, see http: Posting messages over HTTP without Java
Accepted values: | Directory name |
Default: | none |
Description: The name of a directory that contains a set of trusted CA certificates in PEM format. The CA certificate files have to be named after the 32-bit hash of the subject's name. This naming can be created using the c_rehash utility in openssl. For an example, see Configuring TLS on the syslog-ng clients. The syslog-ng OSE application uses the CA certificates in this directory to validate the certificate of the peer.
This option can be used together with the optional ca-file() option.
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
destination d_http { http( url("http://127.0.0.1:8080") tls( ca-dir("dir") cert-file("cert") cipher-suite("cipher") key-file("key") peer-verify(yes|no) ssl-version(<the permitted SSL/TLS version>) ) ); };
Accepted values: | Filename |
Default: | none |
Description: Name of a file that contains an X.509 CA certificate (or a certificate chain) in PEM format. The syslog-ng OSE application uses this certificate to validate the certificate of the HTTPS server. If the file contains a certificate chain, the file must begin with the certificate of the host, followed by the CA certificate that signed the certificate of the host, and any other signing CAs in order.
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
destination d_http { http( url("http://127.0.0.1:8080") tls( ca-file("ca") cert-file("cert") cipher-suite("cipher") key-file("key") peer-verify(yes|no) ssl-version(<the permitted SSL/TLS version>) ) ); };
Accepted values: | Filename |
Default: | none |
Description: Name of a file, that contains an X.509 certificate (or a certificate chain) in PEM format, suitable as a TLS certificate, matching the private key set in the key-file() option. The syslog-ng OSE application uses this certificate to authenticate the syslog-ng OSE client on the destination server. If the file contains a certificate chain, the file must begin with the certificate of the host, followed by the CA certificate that signed the certificate of the host, and any other signing CAs in order.
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
destination d_http { http( url("http://127.0.0.1:8080") tls( ca-dir("dir") ca-file("ca") cert-file("cert") cipher-suite("cipher") key-file("key") peer-verify(yes|no) ssl-version(<the permitted SSL/TLS version>) ) ); };
Accepted values: | Name of a cipher, or a colon-separated list |
Default: | Depends on the OpenSSL version that syslog-ng OSE uses |
Description: Specifies the cipher, hash, and key-exchange algorithms used for the encryption, for example, ECDHE-ECDSA-AES256-SHA384. The list of available algorithms depends on the version of OpenSSL used to compile syslog-ng OSE. To specify multiple ciphers, separate the cipher names with a colon, and enclose the list between double-quotes, for example:
cipher-suite("ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384")
For a list of available algorithms, execute the openssl ciphers -v command. The first column of the output contains the name of the algorithms to use in the cipher-suite() option, the second column specifies which encryption protocol uses the algorithm (for example, TLSv1.2). That way, the cipher-suite() also determines the encryption protocol used in the connection: to disable SSLv3, use an algorithm that is available only in TLSv1.2, and that both the client and the server supports. You can also specify the encryption protocols using ssl-options().
You can also use the following command to automatically list only ciphers permitted in a specific encryption protocol, for example, TLSv1.2:
echo "cipher-suite(\"$(openssl ciphers -v | grep TLSv1.2 | awk '{print $1}' | xargs echo -n | sed 's/ /:/g' | sed -e 's/:$//')\")"
Note that starting with version
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
destination d_http { http( url("http://127.0.0.1:8080") tls( ca-dir("dir") ca-file("ca") cert-file("cert") cipher-suite("cipher") key-file("key") peer-verify(yes|no) ssl-version(<the permitted SSL/TLS version>) ) ); };
Accepted values: | string |
Default: | newline character |
Description: By default, syslog-ng OSE separates the log messages of the batch with a newline character. You can specify a different delimiter by using the delimiter() option. Available in syslog-ng OSE version
For details on how this option influences HTTP batch mode, see http: Posting messages over HTTP without Java
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 options:
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.
|
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 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.
disk-buf-size() | |
Type: | number (bytes) |
Default: | |
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. |
mem-buf-length() | |
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. |
mem-buf-size() | |
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. |
qout-size() | |
Type: | number (messages) |
Default: | 64 |
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 disk-buf-size() are required options.
In the following case reliable disk-buffer() is used.
destination d_demo { network( "127.0.0.1" port(3333) disk-buffer( mem-buf-size(10000) disk-buf-size(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( mem-buf-length(10000) disk-buf-size(2000000) reliable(no) dir("/tmp/disk-buffer") ) ); };
Type: | string list |
Default: |
Description: Custom HTTP headers to include in the request, for example, headers("HEADER1: header1", "HEADER2: header2"). If not set, only the default headers are included, but no custom headers.
The following headers are included by default:
X-Syslog-Host: <host>
X-Syslog-Program: <program>
X-Syslog-Facility: <facility>
X-Syslog-Level: <loglevel/priority>
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.
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. |
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. |
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") ) ); };
Type: | number |
Default: | Use global setting. |
Description: The number of messages that the output queue can store.
Accepted values: | Filename |
Default: | none |
Description: The name of a file that contains an unencrypted private key in PEM format, suitable as a TLS key. If properly configured, the syslog-ng OSE application uses this private key and the matching certificate (set in the cert-file() option) to authenticate the syslog-ng OSE client on the destination server.
The http() destination supports only unencrypted key files (that is, the private key cannot be password-protected).
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
destination d_http { http( url("http://127.0.0.1:8080") tls( ca-dir("dir") ca-file("ca") cert-file("cert") cipher-suite("cipher") key-file("key") peer-verify(yes|no) ssl-version(<the permitted SSL/TLS version>) ) ); };
Type: | POST | PUT |
Default: | POST |
Description: Specifies the HTTP method to use when sending the message to the server.
Type: | string |
Default: |
Description: The password that syslog-ng OSE uses to authenticate on the server where it sends the messages.
Accepted values: | yes | no |
Default: | yes |
Description: Verification method of the peer. The following table summarizes the possible options and their results depending on the certificate of the peer.
The remote peer has: | ||||
---|---|---|---|---|
no certificate | invalid certificate | valid certificate | ||
Local peer-verify() setting | no (optional-untrusted) | TLS-encryption | TLS-encryption | TLS-encryption |
yes (required-trusted) | rejected connection | rejected connection | TLS-encryption |
For untrusted certificates only the existence of the certificate is checked, but it does not have to be valid — syslog-ng accepts the certificate even if it is expired, signed by an unknown CA, or its CN and the name of the machine mismatches.
|
Caution:
When validating a certificate, the entire certificate chain must be valid, including the CA certificate. If any certificate of the chain is invalid, syslog-ng OSE will reject the connection. |
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
Type: | string |
Default: |
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.
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").
Type: |
The proxy server address, in proxy("PROXY_IP:PORT") format. For example, proxy("http://myproxy:3128") |
Default: | None |
You can use the proxy() option to configure the HTTP driver in all HTTP-based destinations to use a specific HTTP proxy that is independent from the proxy configured for the system.
Alternatively, you can leave the HTTP as-is, in which case the driver leaves the default http_proxy and https_proxy environment variables unmodified.
NOTE: Configuring the proxy() option overwrites the default http_proxy and https_proxy environment variables.
The following example illustrates including the proxy() option in your configuration.
destination { http( url("SYSLOG_SERVER_IP:PORT") proxy("PROXY_IP:PORT") method("POST")); };
Type: | list |
Default: | N/A (see below) |
Description: Specifies what syslog-ng OSE does with the log message, based on the response code received from the HTTP server. If the server returns a status code beginning with 2 (for example, 200), syslog-ng OSE assumes the message was successfully sent. Otherwise, the action listed in the following table is applied. For status codes not listed in the following table, if the status code begins with 2 (for example, 299), syslog-ng OSE assumes the message was successfully sent. For other status codes, syslog-ng OSE disconnects. The following actions are possible:
disconnect: Keep trying to resend the message indefinitely.
drop: Drop the message without trying to resend it.
retry: Retry sending the message for a maximum of retries() times (3 by default).
success: Assume the message was successfully sent.
|------+-----------------------------------+------------| | code | explanation | action | |------+-----------------------------------+------------| | 100 | "Continue" | disconnect | | 101 | "Switching Protocols" | disconnect | | 102 | "Processing" | retry | | 103 | "Early Hints" | retry | | 200 | "OK" | success | | 201 | "Created" | success | | 202 | "Accepted" | success | | 203 | "Non-Authoritative Information" | success | | 204 | "No Content" | success | | 205 | "Reset Content" | success | | 206 | "Partial Content" | success | | 300 | "Multiple Choices" | disconnect | | 301 | "Moved Permanently" | disconnect | | 302 | "Found" | disconnect | | 303 | "See Other" | disconnect | | 304 | "Not Modified" | retry | | 307 | "Temporary Redirect" | disconnect | | 308 | "Permanent Redirect" | disconnect | | 400 | "Bad Request" | disconnect | | 401 | "Unauthorized" | disconnect | | 402 | "Payment Required" | disconnect | | 403 | "Forbidden" | disconnect | | 404 | "Not Found" | disconnect | | 405 | "Method Not Allowed" | disconnect | | 406 | "Not Acceptable" | disconnect | | 407 | "Proxy Authentication Required" | disconnect | | 408 | "Request Timeout" | disconnect | | 409 | "Conflict" | disconnect | | 410 | "Gone" | drop | | 411 | "Length Required" | disconnect | | 412 | "Precondition Failed" | disconnect | | 413 | "Payload Too Large" | disconnect | | 414 | "URI Too Long" | disconnect | | 415 | "Unsupported Media Type" | disconnect | | 416 | "Range Not Satisfiable" | drop | | 417 | "Expectation Failed" | disconnect | | 418 | "I'm a teapot" | disconnect | | 421 | "Misdirected Request" | disconnect | | 422 | "Unprocessable Entity" | drop | | 423 | "Locked" | disconnect | | 424 | "Failed Dependency" | drop | | 425 | "Too Early" | drop | | 426 | "Upgrade Required" | disconnect | | 428 | "Precondition Required" | retry | | 429 | "Too Many Requests" | disconnect | | 431 | "Request Header Fields Too Large" | disconnect | | 451 | "Unavailable For Legal Reasons" | drop | | 500 | "Internal Server Error" | disconnect | | 501 | "Not Implemented" | disconnect | | 502 | "Bad Gateway" | disconnect | | 503 | "Service Unavailable" | disconnect | | 504 | "Gateway Timeout" | retry | | 505 | "HTTP Version Not Supported" | disconnect | | 506 | "Variant Also Negotiates" | disconnect | | 507 | "Insufficient Storage" | disconnect | | 508 | "Loop Detected" | drop | | 510 | "Not Extended" | disconnect | | 511 | "Network Authentication Required" | disconnect | |------+-----------------------------------+------------|
To customize the action to take for a particular response code, use the following format: response-action(<response-code> => <action>. To customize multiple response code-action pairs, separate them with a comma, for example:
http( url("http://localhost:8080") response-action(418 => drop, 404 => retry) );
Type: | number (of attempts) |
Default: | 3 |
Description: The number of times syslog-ng OSE attempts to send a message to this destination. If syslog-ng OSE could not send a message, it will try again until the number of attempts reaches retries, then drops the message.
To handle HTTP error responses, if the HTTP server returns 5xx codes, syslog-ng OSE will attempt to resend messages until the number of attempts reaches retries. If the HTTP server returns 4xx codes, syslog-ng OSE will drop the messages.
Type: | string |
Default: | None, uses the libcurl default |
Description: Specifies the permitted SSL/TLS version. Possible values: sslv2, sslv3, tlsv1, tlsv1_0, tlsv1_1, tlsv1_2, tlsv1_3.
An alternative way to specify this option is to put it into a tls() block, together with any other TLS options. This allows you to separate these options and ensure better readability.
Make sure that you specify TLS options either using their own dedicated option (ca-dir(), ca-file(), cert-file(), cipher-suite(), key-file(), peer-verify(), and ssl-version()), or using the tls() block and inserting the relevant options within tls(). Avoid mixing the two methods. In case you do specify TLS options in both ways, the one that comes later in the configuration file will take effect.
destination d_http { http( url("http://127.0.0.1:8080") tls( ca-dir("dir") ca-file("ca") cert-file("cert") cipher-suite("cipher") key-file("key") peer-verify(yes|no) ssl-version(<the permitted SSL/TLS version>) ) ); };
Type: | string |
Default: | A format conforming to the default logfile format. |
Description: Specifies a template defining the logformat to be used in the destination. Macros are described in Macros of syslog-ng OSE. Please note that for network destinations it might not be appropriate to change the template as it changes the on-wire format of the syslog protocol which might not be tolerated by stock syslog receivers (like syslogd or syslog-ng itself). For network destinations make sure the receiver can cope with the custom format defined.
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.
Type: | number [seconds] |
Default: | 0 |
Description: The value (in seconds) to wait for an operation to complete, and attempt to reconnect the server if exceeded. By default, the timeout value is 0, meaning that there is no timeout. Available in version
Type: | URL or list of URLs |
Default: | http://localhost/ |
Description: Specifies the hostname or IP address and optionally the port number of the web service that can receive log data via HTTP. Use a colon (:) after the address to specify the port number of the server. For example: http://127.0.0.1:8000
In case the server on the specified URL returns a redirect request, syslog-ng OSE automatically follows maximum 3 redirects. Only HTTP and HTTPS based redirections are supported.
Starting with version
|
Caution:
If you set multiple URLs in the url() option, set the persist-name() option as well to avoid data loss. |
Starting with version syslog-ng OSE version
url("server1", "server2", "server3"); # comma-separated strings url("server1" "server2" "server3"); # space-separated strings url("server1 server2 server3"); # space-separated within a single string
Type: | string |
Default: | syslog-ng [version]/libcurl[version] |
Description: The value of the USER-AGENT header in the messages sent to the server.
Type: | string |
Default: |
Description: The username that syslog-ng OSE uses to authenticate on the server where it sends the messages.
Type: | yes | no |
Default: | no |
Description: Use the certificate store of the system for verifying HTTPS certificates. For details, see the curl documentation.
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.
This section describes the syslog-ng Open Source Edition (syslog-ng OSE) application's Azure auth header plugin.
For more information about modules in syslog-ng OSE, see Modules in syslog-ng Open Source Edition (syslog-ng OSE).
The Azure auth header plugin is a signal-slot mechanism-based syslog-ng OSE module that generates authorization headers for applications that connect to Microsoft Azure.
You can define the Azure auth header plugin by the following:
azure-auth-header( method("POST") path("/api/logs") content-type("application/json") workspace-id("<workspace-id>") secret("<auth-secret>") )
NOTE: All these options are mandatory. They are used as input for the method that calculates the authorization header.
© ALL RIGHTS RESERVED. 이용 약관 개인정보 보호정책 Cookie Preference Center