A destination is where a log message is sent if the filtering rules match. Similarly to sources, destinations consist of one or more drivers, each defining where and how messages are sent.
|
|
TIP:
If no drivers are defined for a destination, all messages sent to the destination are discarded. This is equivalent to omitting the destination from the log statement. |
To define a destination, add a destination statement to the syslog-ng configuration file using the following syntax:
destination <identifier> {
destination-driver(params); destination-driver(params); ...
};
The following destination statement sends messages to the TCP port 1999 of the 10.1.2.3 host.
destination d_demo_tcp {
network("10.1.2.3" port(1999));
};
If name resolution is configured, you can use the hostname of the target server as well.
destination d_tcp {
network("target_host" port(1999));
};|
|
Caution:
|
The following table lists the destination drivers available in syslog-ng OSE.
| Name | Description |
|---|---|
| amqp() | Publishes messages using the AMQP (Advanced Message Queuing Protocol). |
| elasticsearch() and elasticsearch2 | Sends messages to an Elasticsearch server. The elasticsearch2 driver supports Elasticsearch version 2 and newer. |
| file() | Writes messages to the specified file. |
| graphite() | Sends metrics to a Graphite server to store numeric time-series data. |
| graylog2() | Sends syslog messages to Graylog. |
| hdfs() | Sends messages into a file on a Hadoop Distributed File System (HDFS) node. |
| http() | Sends messages over the HTTP protocol. There are two different implementations of this driver: a Java-based http driver, and an http driver without Java. |
| kafka() | Publishes log messages to the Apache Kafka message bus, where subscribers can access them. |
| loggly() | Sends log messages to the Loggly Logging-as-a-Service provider. |
| logmatic() | Sends log messages to the Logmatic.io Logging-as-a-Service provider. |
| mongodb() | Sends messages to a MongoDB database. |
| network() | Sends messages to a remote host using the BSD-syslog protocol over IPv4 and IPv6. Supports the TCP, UDP, and TLS network protocols. |
| logstore() | Writes messages to the specified binary logstore file. |
| pipe() | Writes messages to the specified named pipe. |
| program() | Forks and launches the specified program, and sends messages to its standard input. |
| redis() | Sends messages as name-value pairs to a Redis key-value store. |
| riemann() | Sends metrics or events to a Riemann monitoring system. |
| smtp() | Sends e-mail messages to the specified recipients. |
| sql() | Sends messages into an SQL database. In addition to the standard syslog-ng packages, the sql() destination requires database-specific packages to be installed. Refer to the section appropriate for your platform in Installing syslog-ng. |
| snmp() | Sends messages to the specified remote host using the SNMP v2c or v3 protocol. |
| stomp() | Sends messages to a STOMP server. |
| syslog() | Sends messages to the specified remote host using the IETF-syslog protocol. The IETF standard supports message transport using the UDP, TCP, and TLS networking protocols. |
| telegram() | Sends log messages to Telegram, which is a secure, cloud-based mobile and desktop messaging app. |
| unix-dgram() | Sends messages to the specified unix socket in SOCK_DGRAM style (BSD). |
| unix-stream() | Sends messages to the specified unix socket in SOCK_STREAM style (Linux). |
| usertty() | Sends messages to the terminal of the specified user, if the user is logged in. |
© ALL RIGHTS RESERVED. 利用規約 プライバシー Cookies Preference Center