https://github.com/logicmonitor/lm-logs-gcp
Google Cloud Platform integration to send logs to Logic Monitor
https://github.com/logicmonitor/lm-logs-gcp
Last synced: 4 months ago
JSON representation
Google Cloud Platform integration to send logs to Logic Monitor
- Host: GitHub
- URL: https://github.com/logicmonitor/lm-logs-gcp
- Owner: logicmonitor
- License: apache-2.0
- Created: 2020-09-09T06:51:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-09-19T06:05:12.000Z (9 months ago)
- Last Synced: 2026-02-12T07:08:12.102Z (4 months ago)
- Language: Shell
- Size: 70.3 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lm-logs-gcp(beta)
Google Cloud Platform integration to send logs to LogicMonitor
## Prerequisites
- LogicMonitor API access tokens.
- We support **VM Instance** logs only.
## Installation instructions
Click **Activate Cloud Shell** on the top right. This opens the Cloud Shell Terminal below the workspace.
In the Terminal, run the following commands to select the project.
``` console
gcloud config set project [PROJECT_ID]
```
Run the following to install the integration:
``` console
source <(curl -s https://raw.githubusercontent.com/logicmonitor/lm-logs-gcp/master/script/gcp.sh) && deploy_lm-logs
```
Installing the integration creates these resources:
- PubSub topic named **export-logs-to-lm** and a pull subscription.
- Virtual Machine (VM) named **lm-logs-forwarder**.
Note: You will be prompted to confirm the region where the VM is deployed. This should be configured by default within your project.
After the script is completed, go to the VM named **lm-logs-forwarder**:
Compute Engine > VM Instances > (select LM-Logs-forward) > Remote access > (Select SSH)
SSH into it and run the following command.
``` console
export GCP_PROJECT_ID="${GCP_PROJECT_ID}"
export LM_COMPANY_NAME="${LM_COMPANY_NAME}"
export LM_COMPANY_DOMAIN="${LM_COMPANY_DOMAIN}"
export LM_ACCESS_ID="${LM_ACCESS_ID}"
export LM_ACCESS_KEY="${LM_ACCESS_KEY}"
source <(curl -s https://raw.githubusercontent.com/logicmonitor/lm-logs-gcp/master/script/vm.sh)
```
Allowed domains:
- lmgov.us
- qa-lmgov.us
- logicmonitor.com
For example, if your URL is https://xyz.logicmonitor.com then,
LM_COMPANY_NAME = xyz
LM_COMPANY_DOMAIN = logicmonitor.com
And for GovCloud if it is like https://xyzgov.lmgov.us
LM_COMPANY_NAME = xyzgov
LM_COMPANY_DOMAIN = lmgov.us
If LM_COMPANY_DOMAIN is not set, by default it will be set as "logicmonitor.com" and for incorrect domain (example: test.com), it will fail.
## Export logs from Logging to Pub Sub
- Go to the Logging page and filter the logs that need to be exported.
- Click **Actions > Create** sink and under **Sink details**, provide the name.
- 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.
- Click **Create sink**.
If there are no issues you should see the logs stream into the Logs page in LogicMonitor.
## Removing the integration
Run the following commands to delete the integration and all its resources:
``` console
source <(curl -s https://raw.githubusercontent.com/logicmonitor/lm-logs-gcp/master/script/gcp.sh) && delete_lm-logs
```