Initialize the PubSub Beat

Prerequisites

  • The Open Collector is installed. If you have not already installed it, follow the instructions in the Open Collector Installation and User Guide, and then return to this topic.

  • To collect log from any GCP service, the services must be enabled on the GCP portal, and you should have one topic and subscription.

  • The following port is open:

    Direction

    Port

    Protocol

    Source

    Outbound

    443

    HTTPS

    pubsubbeat


Initialize the Beat

  1. To confirm the Open Collector is running, run the following command:

    ./lrctl status
    

    You should see the open_collector and metrics as shown in the following graphic:
    image2020-5-26_16-33-53.png

    If the Open Collector is not running correctly, see

    Troubleshoot the Open Collector

    in the Open Collector Installation and User Guide.


  2.  In the Open Collector, run the following command:

    ./lrctl pubsubbeat start
    


  3. Enter the following details:

    The contents of this user credential file are saved in encrypted format.

    1. The Project ID of your project from GCP:
      pubsub_start_2.PNG

    2. The Topic name from GCP. Enter only the portion that appears after topics\. For example, if your GCP console listed the Topic name as projects/datacollector-0000/topics/sample-topic, you would enter sample-topic.
      pubsub_start3.PNG

    3. The Subscription name from GCP. Enter only the portion that appears after subscriptions\. For example, if your GCP console listed the Subscription name as projects/datacollector-0000/topics/sample-subscription, you would enter sample-subscription.
      pubsub_start4.PNG

  4. The configuration saves and the service starts successfully.
    pubsub_start5.PNG

  5. To check the status of the service, run the following command:

    ./lrctl pubsubbeat status
    

    image2020-6-2_14-19-11.png

Default Config Values for Pub Sub Beat:

S. No.

Field Name

Default Value

1.

project

User Provided

2.

HeartbeatInterval

5m0s 

3.

HeartbeatDisabled

false

4.

CredentialsFile

User Provided

5.

Topic

User Provided

6.

Subscription.name

User Provided

7.

json.enabled

true

8.

json.add_error_key

true

9.

subscription.Create

true