An open API service indexing awesome lists of open source software.

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

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"}
```