The syslog-ng Agent for Windows application can send the log messages of the Windows host to a central log server or relay. It is possible to send the same messages to multiple servers, when each server receives the same messages. You can configure failover servers, when the agent sends the messages to a primary server, or to a failover server if the primary becomes unavailable. If the agent loses the connection to a destination server and the reconnection fails, it will generate an eventlog message. The successful reconnection attempt is also logged. (If the server is unavailable for a long time, the agent generates a log message about the failed connection once in every ten seconds.)
If the failover server also becomes unavailable, the application will switch to the next failover server, and so on. If the last failover server is unavailable, it switches back to the primary. The application does not switch back automatically to the primary server if it becomes available again, only if the syslog-ng Agent for Windows has been restarted.
|
NOTE:
The failover servers will use the same options that the primary server uses. Only the name and the address can be configured for the failover servers. |
Similarly to the Linux version, the agent now sends MARK messages to the server to indicate that the client host is alive but there are no log messages to send. A MARK message is sent every ten minutes.
|
Caution:
The syslog-ng Agent for Windows application does not support the unreliable UDP protocol. Configure your central log server to accept logs using TCP or TLS connections. If needed, adjust your firewall configuration to permit such traffic to the log server. |
Procedure 4.1. Configuring the destination log servers
Purpose:
To configure a new destination, complete the following steps:
Steps:
-
Start the configuration interface of the syslog-ng Agent for Windows application.
-
Select , and double-click on .
-
Enter the hostname or the IP address of the log server into the field. If your log server is configured to accept messages on a non-standard port, type the port number into the field. To use the default port (35514
when RLTP™ is enabled and 514
when RLTP™ is disabled), click .
To enable flow-control, select . For details, see the section called “Flow-control in syslog-ng Agent for Windows”.
To use SSL encryption, enable . For details, see Chapter 6, Using SSL-encrypted connections with the syslog-ng Agent.
-
Optional Step: To use the Reliable Log Transfer Protocol™ (RLTP™), enable .
|
NOTE:
You cannot disable flow-control when using the Reliable Log Transfer Protocol™ (RLTP™). |
-
Click .
To compress the messages during transfer to save bandwidth, select the option. Note that for syslog-ng Agent to actually use compression, the following points must be met.
-
The option must be enabled.
-
You must use SSL and/or RLTP to send messages to the logserver (that is, at least one of the or options must be enabled.
-
The logserver must be configured to enable compression. If the logserver is syslog-ng PE the proper allow-compress()
option must be enabled in the source. If the logserver is syslog-ng Store Box, enable the option. Note that to send compressed messages to syslog-ng Store Box, you must use the RLTP™ protocol (for details, see the syslog-ng Documentation page).
-
Change the following options if necessary:
|
NOTE:
Do not adjust or modify the following settings unless you know exactly what you are doing. |
-
: The number of messages sent before waiting for acknowledgement from the server.
-
: After not receiving any message in the given timeframe, syslog-ng Agent terminates the connection with the server.
-
: After not receiving any reply to the messages in the given timeframe, syslog-ng Agent terminates the connection with the server.
-
Click .
-
On tab, select the protocol used to transfer log messages and press to apply the selected template. The following protocol templates are available (for details on the default templates and on customizing the message format, see Chapter 8, Customizing the message format):
-
: Use the legacy BSD-syslog protocol specified in RFC3164. This option uses the following message template: <${PRI}>${BSDDATE} ${HOST} ${MSGHDR}${MESSAGE}
. Within the message part, syslog-ng Agent replaces CRLF with 2 spaces and TAB character with 1 space.
Example 4.1. Legacy BSD Syslog Protocol log
<134>Oct 04 14:45:33 zts-win019.ztswin2008dom.balabit Microsoft-Windows-Eventlog[2880]: ZTSWIN2008DOM\balabit: System Microsoft-Windows-Eventlog: [Information] The Application log file was cleared. (EventID 104)
-
: Use the new IETF-syslog protocol specified in RFC 5424-5426. This is the default setting.
When using the IETF-syslog protocol to transfer Eventlog messages, the syslog-ng Agent application includes the macros (name-value pairs) in the SDATA part of the log message by default. This includes every available Event macro, except EVENT_CONTAINER_COUNTER
, EVENT_DATA
, EVENT_GLOBAL_COUNTER
, EVENT_MSG (EVENT_MESSAGE)
, EVENT_MSG_XML (EVENT_MESSAGE_XML)
. Macros that do not have a value will not be included in the message.
499 <132>1 2010-09-28T12:02:30+02:00 zts-win004.ztswin2003dom.balabit testapp 1220 - [win@18372.4 EVENT_ID="1000" EVENT_NAME="Application" EVENT_REC_NUM="1673" EVENT_SID="S-1-5-21-3460971693-970282485-2299281428-1001" EVENT_SID_TYPE="User" EVENT_SOURCE="testapp" EVENT_TYPE="Warning" EVENT_USERNAME="ZTS-WIN004\\balabit"][meta sequenceId="1" sysUpTime="1"] ZTS-WIN004\balabit: Application testapp: [Warning] test message (EventID 1000)
|
NOTE:
The names of SDATA fields must be in the following format: name@<private enterprise number>, for example, mySDATA-field@18372.4 . (18372.4 is the private enterprise number of BalaBit IT Security, the developer of syslog-ng Agent for Windows.)
-
Messages received from eventlog sources include the win@18372.4 SD-ID. For example, on your syslog-ng PE server you can refer to message fields like: ${.SDATA.win@18372.4.EVENT_SOURCE}
-
Messages received from file sources include the file@18372.4 SD-ID. For example, on your syslog-ng PE server you can refer to message fields like: ${.SDATA.file@18372.4.name} |
To include only the data mandated by RFC5424, disable . To do this, navigate to , select and deselect . For example, only the following data will be included in the message:
[meta sequenceId="value" sysUpTime="value"]
-
: Send log messages in a format compatible with the Snare log monitoring tool.
|
NOTE:
Snare is a tab-separated message format. Within the message part, agent replaces CRLF with 2 space, TAB character with 1 space.
You cannot modify the log format if you have selected this protocol. |
Example 4.2. Snare log
<134>Oct 06 13:49:41 zts-win019.ztswin2008dom.balabit MSWinEventLog 1 Application 1 Wed Oct 06 13:49:41 2010 1 syslog-ng Agent S-1-5-21-551780264-1021859348-3425375765-1003 User Information zts-win019.ztswin2008dom.balabit None Application started 1
|
NOTE:
Selecting the option is identical to using the syslog driver in the Linux/Unix version of syslog-ng. Similarly, selecting is equivalent to the tcp driver of syslog-ng.
Changing to the does not automatically restore the original template. To do so, click after modifying the protocol. |
-
If needed, modify the template of the messages. The format of the messages can be different for the eventlog and the file sources.
|
Caution:
The maximal length of the template is 1023 characters. |
-
If you have a backup server that can accept log messages if the primary log server becomes unavailable, select the tab, click , and enter the hostname or the IP address of the backup log server into the field. Repeat this step if you have more than one backup servers.
-
If you want to send the log messages to more than on server in parallel, so that every server receives every message, repeat Steps 3-4 to add the other destination servers. These servers may have failover servers as well.
-
Select , then . To activate the changes, restart the syslog-ng Agent service.
-
Optional Step: If the host running syslog-ng Agent is sometimes logged in into a domain, sometimes not, then its hostname might change depending on its actual domain membership. This can cause that the hostname appearing in the syslog messages depends on the domain membership of the host. To avoid this situation, select . That way syslog-ng Agent resolves the name of its host from the DNS server, and uses the resolved FQDN in the syslog messages.
Procedure 4.2. Limiting the rate of messages
Purpose:
The syslog-ng Agent can control the rate of messages (message per second) sent to the central server. That way sudden message-bursts can be avoided, and the load of the server is decreased.
To limit the number of messages sent to a destination, complete the following steps:
Steps:
-
Start the configuration interface of the syslog-ng Agent for Windows application.
-
Select .
-
Select . To limit the number of messages that the syslog-ng Agent sends to the server per second, enter the desired limit into the field. By default (0
), the syslog-ng Agent does not limit the number of messages sent.
The throttling parameter applies to the total number of messages sent, not to every source independently. The same value applies to every destination.
-
Click . To activate the changes, restart the syslog-ng Agent service.
Procedure 4.3. Sending MARK messages
Purpose:
If there are no new messages that have to be sent to the destination server, the syslog-ng Agent for Windows application automatically sends a MARK message every ten minutes to notify the server that the connection is still active. The exact format of the MARK message depends on the protocol:
Legacy BSD protocol (RFC3164):
<46>Apr 18 11:34:21 <hostname> -- MARK --
Snare protocol:
<46>Apr 18 11:34:21 <hostname> -- MARK --
Syslog protocol (RFC5424):
82 <46>1 2013-04-23T10:51:29+02:00 <hostname> - - - [meta sequenceId="3"] -- MARK --
To change how often the syslog-ng Agent sends these messages, complete the following steps.
Steps:
-
Start the configuration interface of the syslog-ng Agent for Windows application.
-
Select and double-click on .
-
Select , then select .
-
Set the frequency of MARK messages that the syslog-ng Agent for Windows application sends.
-
Never: Do not send MARK messages.
-
When destination idle: Send MARK messages only if there were no other messages sent to the destination during the specified period.
-
Periodically: Send MARK messages every time the specified period expires.
-
Set the time between two MARK messages in the . By default, this is 600 seconds (10 minutes).
-
Select , then . To activate the changes, restart the syslog-ng Agent service.
Flow-control in syslog-ng Agent for Windows
Starting with version 5 LTS, the flow-control feature of syslog-ng Premium Edition is automatically enabled for the destinations. Using flow-control means that the syslog-ng Agent will stop reading messages from the sources if the destination cannot accept them (for example, because of a network error).
To enable or disable flow-control for a destination, select , double-click on the destination, then select .
|
NOTE:
You cannot disable flow-control when using the Reliable Log Transfer Protocol™ (RLTP™). |
|
NOTE:
The flow-control of syslog-ng Agent 5 LTS replaces the option of earlier versions. |
Flow-control and multiple destinations
Using flow-control on a source has an important side-effect if the messages of the source are sent to multiple destinations. If flow-control is in use and one of the destinations cannot accept the messages, the other destinations do not receive any messages either, because syslog-ng stops reading the source. For example, if messages from a source are sent to two remote servers, and the network connection to one of the servers becomes unavailable, neither servers will receive any messages.
|
NOTE:
Creating separate log paths for the destinations that use the same flow-controlled source does not avoid the problem. |