• No results found

network() destination options

Sending messages to a remote log server using the RFC3164 protocol (network() driver)

7.9.1. network() destination options

Thenetwork()driver sends messages to a remote host (for example a syslog-ng server or relay) on the local intranet or internet using the RFC3164 syslog protocol (for details about the protocol, see Section 2.8.1, BSD-syslog or legacy-syslog messages (p. 11)). Thenetwork()driver supports sending messages using the UDP, TCP, or the encrypted TLS networking protocols.

These destinations have the following options:

flags()

no-multi-line, syslog-protocol Type:

empty set Default:

Description: Flags influence the behavior of the destination driver.

no-multi-line: Theno-multi-lineflag disables line-breaking in the messages; the entire message is converted to a single line.

syslog-protocol: Thesyslog-protocolflag instructs the driver to format the messages according to the new IETF syslog protocol standard (RFC5424), but without the frame header. If this flag is enabled, macros used for the message have effect only for the text of the message, the message header is formatted to the new standard. Note that this flag is not needed for thesyslog driver, and that thesyslogdriver automatically adds the frame header to the messages.

flush-lines() number Type:

Use global setting.

Default:

Description: Specifies how many lines are flushed to a destination at a time. 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.

The syslog-ng OSE application flushes the messages if it has sentflush-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.

flush-timeout() (DEPRECATED) time in milliseconds Type:

Use global setting.

Default:

Description: This is a deprecated option. Specifies the time syslog-ng waits for lines to accumulate in its output buffer. For details, see theflush-lines()option.

frac-digits() number Type:

0 Default:

Description: The syslog-ng application can store fractions of a second in the timestamps according to the ISO8601 format. Thefrac-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 that syslog-ng can add the fractions to non-ISO8601 timestamps as well.

Description: Specifies the Type-of-Service value of outgoing packets.

ip-ttl()

number Type:

0 Default:

Description: Specifies the Time-To-Live value of outgoing packets.

keep-alive() yes or no Type:

yes Default:

Description: Specifies whether connections to destinations should be closed when syslog-ng is reloaded. Note that this applies to the client (destination) side of the syslog-ng connections, server-side (source) connections are always reopened after receiving a HUP signal unless thekeep-aliveoption is enabled for the source.

localip() string Type:

0.0.0.0 Default:

Description: The IP address to bind to before connecting to target.

network() destination options

localport() number Type:

0 Default:

Description: The port number to bind to. Messages are sent from this port.

log-fifo-size() number Type:

Use global setting.

Default:

Description: The number of messages that the output queue can store.

mark-freq()

number [seconds]

Accepted values:

1200 Default:

Description: An alias for the obsoletemark()option, retained for compatibility with syslog-ng version 1.6.x.

The number of seconds between twoMARKmessages.MARKmessages are generated when there was no message traffic to inform the receiver that the connection is still alive. If set to zero (0), noMARKmessages are sent. The mark-freq()can be set for global option and/or everyMARKcapable destination driver ifmark-mode()is periodical or dst-idle or host-idle. Ifmark-freq()is not defined in the destination, then themark-freq() will be inherited from the global options. If the destination uses internal mark-mode(), then the global mark-freq()will be valid (does not matter whatmark-freq()set in the destination side).

mark-mode()

internal|dst-idle|host-idle|periodical|none|global Accepted values:

internalfor pipe, program drivers

nonefor file, unix-dgram, unix-stream drivers globalfor syslog, tcp, udp destinations host-idlefor global option

Default:

Description: The mark-mode() option can be set for the following destination drivers: file(), program(), unix-dgram(), unix-stream(), network(), pipe(), syslog() and in global option.

internal: When internal mark mode is selected, internal source should be placed in the log path as this mode does not generate mark by itself at the destination. This mode only yields the mark messages from internal source. This is the mode as syslog-ng OSE 3.3 worked. will be generated

dst-idle: Sends MARKsignal if there was NO traffic on destination drivers. MARKsignal from internal source will be dropped.

MARKsignal can be sent by the following destination drivers:network(),syslog(),program(), file(),pipe(),unix-stream(),unix-dgram().

host-idle: SendsMARKsignal if there was NO local message on destination drivers. For example MARKis generated even if messages were received from tcp.MARKsignal from internal source will be dropped.

MARKsignal can be sent by the following destination drivers:network(),syslog(),program(), file(),pipe(),unix-stream(),unix-dgram().

periodical: SendsMARKsignal perodically, regardless of traffic on destination driver.MARKsignal from internal source will be dropped.

MARKsignal can be sent by the following destination drivers:network(),syslog(),program(), file(),pipe(),unix-stream(),unix-dgram().

none: Destination driver drops allMARKmessages. If an explicit mark-mode() is not given to the drivers wherenoneis the default value, thennonewill be used.

global: Destination driver uses the global mark-mode() setting. Note that setting the global mark-mode()to global causes a syntax error in syslog-ng OSE.

Note

In case ofdst-idle,host-idleandperiodical;MARKmessage will not be written in the destination, if it is not open yet.

Available in syslog-ng OSE 3.4 and later.

port() or destport() number Type:

601 Default:

Description: The port number to connect to. Note that the default port numbers used by syslog-ng do not comply with the latest RFC which was published after the release of syslog-ng 3.0.2, therefore the default port numbers will change in the future releases.

so-broadcast() yes or no Type:

no Default:

network() destination options

Description: This option controls theSO_BROADCASTsocket option required to make syslog-ng send messages to a broadcast address. For details, see thesocket(7)manual page.

so-keepalive() yes or no Type:

no Default:

Description: Enables keep-alive messages, keeping the socket open. This only effects TCP and UNIX-stream sockets. For details, see thesocket(7)manual page.

so-rcvbuf() number Type:

0 Default:

Description: Specifies the size of the socket receive buffer in bytes. For details, see thesocket(7)manual page.

so-sndbuf() number Type:

0 Default:

Description: Specifies the size of the socket send buffer in bytes. For details, see thesocket(7)manual page.

spoof-source() yes or no Type:

no Default:

Description: Enables source address spoofing. This means that the host running syslog-ng generates UDP packets with the source IP address matching the original sender of the message. It is useful when you want to perform some kind of preprocessing via syslog-ng then forward messages to your central log management solution with the source address of the original sender. This option only works for UDP destinations though the original message can be received by TCP as well. This option is only available if syslog-ng was compiled using the--enable-spoof-sourceconfiguration option.

suppress() seconds Type:

0 (disabled) Default:

tcp-keepalive-intvl() number [seconds]

Type:

0 Default:

Description: Specifies the interval (number of seconds) between subsequential keepalive probes, regardless

of the traffic exchanged in the connection. This option is equivalent to

/proc/sys/net/ipv4/tcp_keepalive_intvl. The default value is 0, which means using the kernel default.

Warning

Thetcp-keepalive-time(),tcp-keepalive-probes(), andtcp-keepalive-intvl()options only work on platforms which support theTCP_KEEPCNT,TCP_KEEPIDLE,andTCP_KEEPINTVLsetsockopts. Currently, this is Linux.

A connection that has no traffic is closed after tcp-keepalive-time() + tcp-keepalive-intvl() * tcp-keepalive-probes()seconds.

Available in syslog-ng OSE version 3.4 and later.

tcp-keepalive-probes() number

Type:

0 Default:

Description: Specifies the number of unacknowledged probes to send before considering the connection dead.

This option is equivalent to/proc/sys/net/ipv4/tcp_keepalive_probes. The default value is0, which means using the kernel default.

Warning

Thetcp-keepalive-time(),tcp-keepalive-probes(), andtcp-keepalive-intvl()options only work on platforms which support theTCP_KEEPCNT,TCP_KEEPIDLE,andTCP_KEEPINTVLsetsockopts. Currently, this is Linux.

A connection that has no traffic is closed after tcp-keepalive-time() + tcp-keepalive-intvl() * tcp-keepalive-probes()seconds.

Available in syslog-ng OSE version 3.4 and later.

tcp-keepalive-time() number [seconds]

Type:

0 Default:

Description: Specifies the interval (in seconds) between the last data packet sent and the first keepalive probe.

This option is equivalent to/proc/sys/net/ipv4/tcp_keepalive_time. The default value is0, which means using the kernel default.

network() destination options

Warning

Thetcp-keepalive-time(),tcp-keepalive-probes(), andtcp-keepalive-intvl()options only work on platforms which support theTCP_KEEPCNT,TCP_KEEPIDLE,andTCP_KEEPINTVLsetsockopts. Currently, this is Linux.

A connection that has no traffic is closed after tcp-keepalive-time() + tcp-keepalive-intvl() * tcp-keepalive-probes()seconds.

Available in syslog-ng OSE version 3.4 and later.

template() string Type:

A format conforming to the default logfile format.

Default:

Description: Specifies a template defining the logformat to be used in the destination. Macros are described in Section 11.1.5, Macros of syslog-ng OSE (p. 265). 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 (likesyslogdor syslog-ng itself). For network destinations make sure the receiver can cope with the custom format defined.

Note

If a message uses the IETF-syslog format (RFC5424), only the text of the message can be customized (that is, the

$MESSAGE part of the log), the structure of the header is fixed.

template-escape() yes or no Type:

no Default:

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.

throttle() number Type:

0 Default:

Description: Sets the maximum number of messages sent to the destination per second. Use this output-rate-limiting functionality only when using large enough buffers as well to avoid the risk of losing messages. Specifying0or a lower value sets the output limit to unlimited.

Description: Convert timestamps to the timezone specified by this option. If this option is not set, then the original timezone information in the message is used. Converting the timezone changes the values of all date-related macros derived from the timestamp, for example,HOUR. For the complete list of such macros, see Section 11.1.3, Date-related macros (p. 263).

The timezone can be specified as using the name of the (for exampletime-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/zoneinfodirectory.

tls()

tls options Type:

n/a Default:

Description: This option sets various options related to TLS encryption, for example, key/certificate files and trusted CA locations. TLS can be used only with tcp-based transport protocols. For details, see Section 10.4, TLS options (p. 256).

transport()

udp, tcp, or tls Type:

tcp Default:

Description: Specifies the protocol used to send messages to the destination server.

If you use theudptransport, syslog-ng OSE automatically sends multicast packets if a multicast destination address is specified. Thetcptransport does not support multicasting.

ts-format()

rfc3164, bsd, rfc3339, iso Type:

rfc3164 Default:

Description: Override the global timestamp format (set in the globalts-format()parameter) for the specific destination. For details, see Section ts-format() (p. 248).