In syslog-ng OSE 4.5 and later versions it is possible to send data to Google Cloud Pub/Sub using its HTTP REST API.

Prerequisites

For more information, see the Google Pub/Sub tutorial.

To configure syslog-ng OSE, the name of the project and the target topic of the data is required.

Example: minimal configuration of a Pub/Sub destination

destination d_pubsub {
  google-pubsub(
    project("syslog-ng-project")
    topic("syslog-ng-topic")
    auth(
      service-account(
        key("/path/to/service-account-key.json")
      )
    )
  );
};

This driver is a reusable configuration snippet configured to send log messages using the http() driver using a template. The source of the Google Pub/Sub configuration snippet can be accessed on GitHub.

Updated: