Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
Send logs from Google Cloud Platform (GCP) to LM Logs for analysis.
1. At the top right of your Google Cloud account, click Activate Cloud Shell.
This opens the Cloud Shell Terminal below the workspace.
2. In the Terminal, run the following commands to select the project.
gcloud config set project [PROJECT_ID]
3. Run the following command to install the integration:
source <(curl -s https://raw.githubusercontent.com/logicmonitor/lm-logs-gcp/master/script/gcp.sh) && deploy_lm-logs
Installing the integration creates these resources:
Note: You will be prompted to confirm the region where the VM is deployed. This should already be configured within your project.
1. After the installation script completes, go the Compute Engine > VM Instances and select lm-logs-forwarder.
2. Under Remote access, select SSH.
3. SSH into the VM (lm-logs-forwarder) and run the following command, filling in the values:
source <(curl -s https://raw.githubusercontent.com/logicmonitor/lm-logs-gcp/master/script/vm.sh)
You need to create a sink from Logging to the PubSub topic export-logs-to-lm (this was created at installation).
1. In the Logging page, filter the logs that you want to export.
Note: We recommend that you also use the filters to remove logs that contain sensitive information so that they are not sent to LogicMonitor
2. Click Actions > Create sink and under Sink details, provide a name.
3. Under Sink destination, choose Cloud Pub/Sub as the destination and select export-logs-to-lm.
Note: the pub/sub can be located in a different project.
4. Click Create sink.
If there are no issue, you should see the logs stream into the Logs page in LogicMonitor.
Run the following command to delete the integration and all its resources:
source <(curl -s https://raw.githubusercontent.com/logicmonitor/lm-logs-gcp/master/script/gcp.sh) && delete_lm-logs
In This Article