Chat now with support
Chat with Support

syslog-ng Premium Edition 7.0.34 - Administration Guide

Preface Introduction to syslog-ng The concepts of syslog-ng Installing syslog-ng PE The syslog-ng PE quick-start guide The syslog-ng PE configuration file Collecting log messages — sources and source drivers
How sources work default-network-drivers: Receive and parse common syslog messages internal: Collecting internal messages file: Collecting messages from text files google-pubsub: collecting messages from the Google Pub/Sub messaging service wildcard-file: Collecting messages from multiple text files linux-audit: Collecting messages from Linux audit logs mssql, oracle, sql: collecting messages from an SQL database network: Collecting messages using the RFC3164 protocol (network() driver) office365: Fetching logs from Office 365 osquery: Collect and parse osquery result logs pipe: Collecting messages from named pipes program: Receiving messages from external applications python: writing server-style Python sources python-fetcher: writing fetcher-style Python sources snmptrap: Read Net-SNMP traps syslog: Collecting messages using the IETF syslog protocol (syslog() driver) system: Collecting the system-specific log messages of a platform systemd-journal: Collecting messages from the systemd-journal system log storage systemd-syslog: Collecting systemd messages using a socket tcp, tcp6,udp, udp6: Collecting messages from remote hosts using the BSD syslog protocol udp-balancer: Receiving UDP messages at very high rate unix-stream, unix-dgram: Collecting messages from UNIX domain sockets windowsevent: Collecting Windows event logs
Sending and storing log messages — destinations and destination drivers
elasticsearch2>: Sending messages directly to Elasticsearch version 2.0 or higher (DEPRECATED) elasticsearch-http: Sending messages to Elasticsearch HTTP Event Collector file: Storing messages in plain-text files google_bigquery(): Sending logs to a Google BigQuery table google_bigquery_managedaccount(): Sending logs to a Google BigQuery table authenticated by Google Cloud managed service account google_pubsub(): Sending logs to the Google Cloud Pub/Sub messaging service google_pubsub-managedaccount(): Sending logs to the Google Cloud Pub/Sub messaging service authenticated by Google Cloud managed service account hdfs: Storing messages on the Hadoop Distributed File System (HDFS) http: Posting messages over HTTP kafka(): Publishing messages to Apache Kafka (Java implementation) (DEPRECATED) kafka-c(): Publishing messages to Apache Kafka using the librdkafka client (C implementation) logstore: Storing messages in encrypted files mongodb: Storing messages in a MongoDB database network: Sending messages to a remote log server using the RFC3164 protocol (network() driver) pipe: Sending messages to named pipes program: Sending messages to external applications python: writing custom Python destinations sentinel(): Sending logs to the Microsoft Azure Sentinel cloud snmp: Sending SNMP traps smtp: Generating SMTP messages (email) from logs splunk-hec: Sending messages to Splunk HTTP Event Collector sql(): Storing messages in an SQL database stackdriver: Sending logs to the Google Stackdriver cloud syslog: Sending messages to a remote logserver using the IETF-syslog protocol syslog-ng(): Forward logs to another syslog-ng node tcp, tcp6, udp, udp6: Sending messages to a remote log server using the legacy BSD-syslog protocol (tcp(), udp() drivers) unix-stream, unix-dgram: Sending messages to UNIX domain sockets usertty: Sending messages to a user terminal — usertty() destination Client-side failover
Routing messages: log paths, flags, and filters Global options of syslog-ng PE TLS-encrypted message transfer Advanced Log Transport Protocol Reliability and minimizing the loss of log messages Manipulating messages parser: Parse and segment structured messages Processing message content with a pattern database Correlating log messages Enriching log messages with external data Monitoring statistics and metrics of syslog-ng Multithreading and scaling in syslog-ng PE Troubleshooting syslog-ng Best practices and examples The syslog-ng manual pages Glossary

Error messages you may encounter while using the google_pubsub() destination

The following table describes the possible error messages that you may encounter while using the google_pubsub() destination.

Status code 400
Complete response while running with trace messages enabled
"error": {
	"code": 400,   
	"message": "The value for message_count is too large. You passed 1001 in the request, but the maximum value is 1000.",
	"status": "INVALID_ARGUMENT"
	  }
Possible reason(s)

There are too many messages in one batch. Google Pub/Sub allows maximum 1000 messages per batch.

Possible solution(s)

Decrease the value of the batch-lines() option if you modified it previously.

Status code 400
Complete response while running with trace messages enabled
"error": {
	"code": 400,
	"message": "Request payload size exceeds the limit: 10485760 bytes.",
	"status": "INVALID_ARGUMENT"
	  }
Possible reason(s)

The batch size is too large. Google Pub/Sub allows maximum 10MB per batch.

Possible solution(s)

To solve the issue, try one of the following methods:

  • Decrease the message size (consider the length of data and additional parameters combined).

  • Decrease the batch size with the batch-lines() option. Fewer, but bigger messages result in a smaller batch size, so adjust the value of the batch-lines() option to decrease your throughput.

Status code 403
Complete response while running with trace messages enabled
"error": {
	"code": 403,
	"message": "User not authorized to perform this action.",
	"status": "PERMISSION_DENIED" 
	 }
Possible reason(s)

One of the following possible reasons behind the error message:

  • Wrong credentials.

  • Insufficient permissions.

Possible solution(s)

To solve the issue, try one of the following methods:

  • Check your credentials .JSON file that you downloaded from the UI of Google Pub/Sub.

  • Check the associated "roles" of your service account. The google_pubsub() destination requires the Pub/Sub Publisher role to operate.

Status code 404
Complete response while running with trace messages enabled
"error": {
	"code": 404,
	"message": "Requested project not found or user does not have access to it (project=YOUR_PROJECT). Make sure to specify the unique project identifier and not the Google Cloud Console display name.",
	"status": "NOT_FOUND"
	 }
Possible reason(s)

You specified an incorrect project ID. The string YOUR_PROJECT is the project name provided in the configuration, and the project name you must specify.

Possible solution(s)

The project name you can find on the Pub/Sub UI is not necessarily the same as the project ID you specified in the YOUR_PROJECT string in your configuration. Make sure you use the project name provided in the YOUR_PROJECT string in your configuration.

Status code 404
Complete response while running with trace messages enabled
"error": {
	"code": 404,
	"message": "Resource not found (resource=YOUR_TOPIC).",
	"status": "NOT_FOUND"
	 }
Possible reason(s)

You specified an incorrect topic ID. The string YOUR_TOPIC is the topic ID you provided in the configuration, and the topic ID you must specify.

Possible solution(s)

Make sure you use the topic ID you provided in the YOUR_TOPIC string in the configuration, and make sure that you have sufficient permissions to access it.

Status code 429
Complete response while running with trace messages enabled
"error": {
	"code": 429,
	"message": "Quota exceeded for quota metric 'Regional publisher throughput, kB' and limit 'Regional publisher throughput, kB per minute per region' of service 'pubsubgoogleapiscom' for consumer 'project_number:127287437417'",
	"status": "RESOURCE_EXHAUSTED"
	  }
Possible reason(s)

You exceeded the quota for the given Google Cloud project.

Possible solution(s)

Review your Google Cloud project's quota and adjust it according to Google's documentation if necessary.

google_pubsub-managedaccount(): Sending logs to the Google Cloud Pub/Sub messaging service authenticated by Google Cloud managed service account

From syslog-ng Premium Edition (syslog-ng PE) version 7.0.32, you can use the the google_pubsub_managedaccount() destination to generate your own messaging Google Pub/Sub infrastructure with syslog-ng PE as a Google Cloud managed service account authenticated "Publisher" entity, utilizing the HTTP REST interface of the service. This authentication method requires syslog-ng PE to run inside Google Cloud (for example, on a VM instance running in Google Cloud Compute Engine).

The google_pubsub_managedaccount() destination is equivalent to syslog-ng PE's google_pubsub(): Sending logs to the Google Cloud Pub/Sub messaging service, only the authentication method is different.

Similarly to syslog-ng PE's stackdriver: Sending logs to the Google Stackdriver cloud, the google_pubsub_managedaccount() destination is an asynchronous messaging service connected to Google's infrastructure.

For more information about Google Pub/Sub's messaging service, see What Is Pub/Sub?. The rest of this section and its subsections assume that you are familiar with the Google Pub/Sub messaging service, and its concepts, and terminology.

Limitations

The current implementation of the google_pubsub() and google_pubsub_managedaccount() destinations has the following limitations:

No message-based acknowledgement: While Google Pub/Sub acknowledges the batch of received messages, it also sends individual acknowledgement ID's to each message. However, we currently do not track individual messages inside Google Pub/Sub. Under normal operation circumstances, the lack of tracking individual messages has no effect on message delivery, and even allows flow control to work properly. However, in case of an error, the only solution is to repeat the entire batch, which can lead to message duplication in case Google Pub/Sub acknowledged part of the previous batch despite indicating an overall error.

NOTE: This behavior, called At-Least-Once delivery, means that if an error occurs, it is more acceptable to duplicate messages than to lose any of them.

NOTE: Typically, only the central syslog-ng PE server uses this destination. For more information on the server mode, see Server mode.

NOTE: The google_pubsub() and google_pubsub_managedaccount() destinations cannot fetch logs, they only serve as "Publisher" entities in the Google Pub/Sub service.

Configuring the google_pubsub_managedaccount() destination

From syslog-ng Premium Edition (syslog-ng PE) version 7.0.32, you can use the the google_pubsub_managedaccount() destination to generate your own messaging Google Pub/Sub infrastructure with syslog-ng PE as a Google Cloud managed service account authenticated "Publisher" entity, utilizing the HTTP REST interface of the service. This authentication method requires syslog-ng PE to run inside Google Cloud (for example, on a VM instance running in Google Cloud Compute Engine).

The google_pubsub_managedaccount() destination is equivalent to syslog-ng PE's google_pubsub(): Sending logs to the Google Cloud Pub/Sub messaging service, only the authentication method is different.

Similarly to syslog-ng PE's stackdriver: Sending logs to the Google Stackdriver cloud, the google_pubsub_managedaccount() destination is an asynchronous messaging service connected to Google's infrastructure.

For more information about Google Pub/Sub's messaging service, see What Is Pub/Sub?. The rest of this section and its subsections assume that you are familiar with the Google Pub/Sub messaging service, and its concepts, and terminology.

Prerequisites

To configure the google_pubsub_managedaccount() destination, you must have each of the following:

For more information, see Building a one-to-many Pub/Sub system.

Declaration
destination d_google_pubsub_managed {
  google_pubsub_managedaccount(
    service-account(<the-name-of-your-service-account>)
    project(<the-name-of-your-pub-sub-project>)
    topic(<the-name-of-your-pub-sub-topic>)
  );
};
Configuration

The following example is a sample configuration for the google_pubsub_managedaccount() destination.

Example: Configuring the google_pubsub_managedaccount() destination

In your syslog-ng PE configuration, you can use the google_pubsub_managedaccount() destination as follows:

destination d_google_pubsub_managed {
  google_pubsub(
    service-account("default")
    project(mypubsubproject)
    topic(mytopic)
  );
};

NOTE: The authentication method used by google_pubsub_managedaccount() requires syslog-ng PE to run inside Google Cloud (for example, on a VM instance in Google Cloud Compute Engine).

NOTE: The google_pubsub_managedaccount() destination is a customized google_pubsub() destination. As a result, the google_pubsub_managedaccount() destination accepts google_pubsub() destination options and http() destination option and its parameters, with the exception of the authentication-specific options. While using the options of the http() destination and their parameters with the google_pubsub_managedaccount()destination, the hyphen (-) and underscore (_) characters are interchangeable.

Specific options and parameters

The google_pubsub_managedaccount() destination has the following specific option and parameter:

service-account()

NOTE: The default value of service-account() option is service-account("default") which is sufficient in case of a single service account with the Pub/Sub Publisher role. The service-account() option is optional.

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating