destination: Forward, send, and store log messages

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.

To define a destination, add a destination statement to the syslog-ng.conf configuration file using the following syntax:

   destination <identifier> {
        destination-driver(params); destination-driver(params); ...
    };

Note the following points:

  • Do not define the same drivers with the same parameters more than once, because it will cause problems. For example, do not open the same file in multiple destinations.
  • Do not use the same destination in different log paths, because it can cause problems with most destination types. Instead, use filters and log paths to avoid such situations.
  • Sources and destinations are initialized only when they are used in a log statement. For example, AxoSyslog starts listening on a port or starts polling a file only if the source is used in a log statement. For details on creating log statements, see log: Filter and route log messages using log paths, flags, and filters.

Example: A simple destination statement

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));
    };

The following destination drivers are available in AxoSyslog. If these destinations do not satisfy your needs, you can extend AxoSyslog and write your own destination, for example, in C, Java, or Python. For details, see Write your own custom destination in Java or Python.


amqp: Publish messages using AMQP

Send data to Google BigQuery

ClickHouse database

collectd: Send metrics to collectd

discord: Send alerts and notifications to Discord

elasticsearch2: DEPRECATED - Send messages directly to Elasticsearch version 2.0 or higher

Send messages to Elasticsearch data streams

elasticsearch-http: Send messages to Elasticsearch HTTP Bulk API

file: Store messages in plain-text files

Send data to Google Pub/Sub

graphite: Send metrics to Graphite

graylog2: Send logs to Graylog

hdfs: Store messages on the Hadoop Distributed File System (HDFS)

java: Post messages over HTTP using Java

http: Post messages over HTTP without Java

kafka: Publish messages to Apache Kafka (Java implementation)

kafka-c(): Publish messages to Apache Kafka (C implementation)

loggly: Send logs to Loggly

logmatic: Send logs to Logmatic.io

Send messages to Falcon LogScale

loki: Grafana Loki

mongodb(): Store messages in a MongoDB database

mqtt(): Send messages from a local network to an MQTT broker

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

Send messages to OpenObserve

opensearch: Send messages to OpenSearch

osquery: Send log messages to osquery's syslog table

Send logs, metrics, and traces to OpenTelemetry

pipe: Send messages to named pipes

program: Send messages to external applications

pseudofile()

python: Write custom Python destinations

redis: Store name-value pairs in Redis

riemann: Monitor your data with Riemann

s3: Amazon S3

slack: Send alerts and notifications to a Slack channel

smtp: Generate SMTP messages (emails) from logs

snmp: Send SNMP traps

splunk-hec-event: Send messages to Splunk HEC

sql: Store messages in an SQL database

stdout: Send messages to standard output

stomp: Publish messages using STOMP

Sumo Logic destinations: sumologic-http() and sumologic-syslog()

syslog: Send messages to a remote logserver using the IETF-syslog protocol

syslog-ng(): Forward logs to another syslog-ng node

syslog-ng-otlp(): Forward logs to another node using OpenTelemetry

tcp, tcp6, udp, udp6: OBSOLETE - Send messages to a remote log server using the legacy BSD-syslog protocol (tcp(), udp() drivers)

telegram: Send messages to Telegram

unix-stream, unix-dgram: Send messages to UNIX domain sockets

usertty: Send messages to a user terminal

Write your own custom destination in Java or Python

Client-side failover