https://github.com/logicmonitor/lm-logs-sdk-go
Go SDK for lm-logs
https://github.com/logicmonitor/lm-logs-sdk-go
Last synced: 5 months ago
JSON representation
Go SDK for lm-logs
- Host: GitHub
- URL: https://github.com/logicmonitor/lm-logs-sdk-go
- Owner: logicmonitor
- License: mit
- Created: 2020-08-17T12:50:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T05:14:34.000Z (almost 3 years ago)
- Last Synced: 2024-12-30T00:13:28.573Z (over 1 year ago)
- Language: Go
- Size: 20.5 KB
- Stars: 1
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lm-logs-sdk-go(1.0.0)
Go SDK for sending logs to LogicMonitor
**NOTE:** This SDK was created for use by LogicMonitor-built log integrations and is not intended to be used or supported otherwise.
```go
// Initialize the library
lmIngest := ingest.Ingest{
CompanyName: "<>",
AccessID: "<>",
AccessKey: "<>",
LogSource: "<>",
VersionID: "<>",
}
// Create logs
logs := []ingest.Log{{
Message: "Hello from LogicMonitor!",
ResourceID: map[string]string{"<>": "<>"},
}}
// Send logs to Logic Monitor
ingestResponse, err := lmIngest.SendLogs(logs)
log.Println(ingestResponse) // {"success":true,"message":"Accepted","errors":null,"RequestId":"c952611b-edbf-b670-f94a-9023b38bfdba"}
```