lm-logs-sdk-go

module
v0.0.0-...-44b9108 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2021 License: MIT

README

lm-logs-sdk-go(0.0.1)

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.

// Initialize the library
lmIngest := ingest.Ingest{
	CompanyName: "<<account-name>>",
	AccessID:  "<<accesss-id>>",
	AccessKey: "<<access-key>>",
	LogSource: "<<log-source>>",
	VersionID: "<<version-id>>",
}

// Create logs
logs := []ingest.Log{{
    Message:    "Hello from LogicMonitor!",
    ResourceID: map[string]string{"<<lm-property>>": "<<lm-property-value>>"},
}}


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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL