You can use the following example as a configuration block template for declaring the google-pubsub() source in your configuration:
google-pubsub(project("project") subscription("sub") credentials("creds.json") );
You can use the following example as a configuration block template for declaring the google-pubsub() source in your configuration:
google-pubsub(project("project") subscription("sub") credentials("creds.json") );
From version 7.0.22, syslog-ng Premium Edition (syslog-ng PE) can collect messages from Google Pub/Sub.
NOTE: The rest of this section assumes that you are familiar with the Google Pub/Sub messaging service, and its concepts and terminology.
The syslog-ng PE application's google-pubsub() source collects Google Pub/Sub messages in a format that has two message parts (Message body and Message attributes) on the Google Cloud Platform side.
NOTE: Google Pub/Sub messages must contain at least one of the Message body and Message attributes message parts.
For more information about Google Pub/Sub message format on the Google Cloud Platform side, see Message format.
For more information about publishing Google Pub/Sub messages on the Google Cloud Platform side, see Publishing messages.
After collecting the contents of the Google Pub/Sub message's Message body field as raw, unformatted data, the google-pubsub() source stores the message contents in the $MESSAGE syslog-ng PE macro. Next, syslog-ng PE prepends a header to the message contents, and the resulting data will form the syslog-ng PE output.
Incoming message contents on the Google Pub/Sub Cloud side:
<38>Feb 25 14:09:07 testhost testapp: test message - 1
The contents of the relevant $MESSAGE macro:
* name='MESSAGE', value='<38>Feb 25 14:09:07 testhost testapp: test message - 1'
By default, the syslog-ng PE application prepends a Message header to the $MESSAGE macro contents to form an output with a similar structure:
<13>Sep 29 14:59:28 ubuntu-xenail-amd64 <38>Feb 25 14:09:07 testhost testapp: test message - 1
The syslog-ng PE application's google-pubsub() source collects Google Pub/Sub messages in a format that has two message parts (Message body and Message attributes) on the Google Cloud Platform side.
NOTE: Google Pub/Sub messages must contain at least one of the Message body and Message attributes message parts.
After collecting the contents of the Google Pub/Sub message's Message body field as raw, unformatted data, the google-pubsub() source stores the message contents in the $MESSAGE syslog-ng PE macro. Next, syslog-ng PE prepends a header to the message contents, and the resulting data will form the syslog-ng PE output.
If the Google Pub/Sub message also contains data from Message attributes, these attributes are displayed in the output as attribute names following the prepended prefix.
The following example shows illustrates what Message body contents on the Google Pub/Sub Cloud side will look like in the $MESSAGE syslog-ng PE macro:
With the incoming Message body contents on the Google Pub/Sub Cloud side:
<38>Feb 25 14:09:07 testhost testapp: test message - 1
The contents of the relevant $MESSAGE macro will look similar to this:
* name='MESSAGE', value='<38>Feb 25 14:09:07 testhost testapp: test message - 1'
The syslog-ng PE application's google-pubsub() source collects Google Pub/Sub messages in a format that has two message parts (Message body and Message attributes) on the Google Cloud Platform side.
NOTE: Google Pub/Sub messages must contain at least one of the Message body and Message attributes message parts.
The contents of the message attributes can be customized with the prefix() option, where the prefix is .pubsub. by default.
The contents of the message attributes message part are key-value pairs, for example, ${.pubsub.attribute_name}.
Incoming message contents on the Google Pub/Sub Cloud side:
<38>Feb 25 14:09:07 testhost testapp: test message - 1
Incoming attribute values to the message on the Google Pub/Sub Cloud side:
* attrib_name1="attrib_value1" * attrib_name2="attrib_value2"
The contents and key-values of the relevant $MESSAGE macros:
* name='MESSAGE', value='<38>Feb 25 14:09:07 testhost testapp: test message - 1' * attrib_name1="attrib_value1" * attrib_name2="attrib_value2"
By default, the syslog-ng PE application prepends a Message header to the $MESSAGE macro contents to form an output with a similar structure:
<13>Sep 29 14:59:28 ubuntu-xenail-amd64 <38>Feb 25 14:09:07 testhost testapp: test message - 1
© ALL RIGHTS RESERVED. Nutzungsbedingungen Datenschutz Cookie Preference Center