loganalytics

package module
v0.0.0-...-ea4473d Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 10 Imported by: 0

README

go-azure-log-analytics

Go API for sending custom logs to Azure Log Analytics

License MIT Go version GoDoc Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// The workspace to send logs to
	WorkspaceID string

	// The secret used to authenticate
	SharedKey string

	// The custom logs table
	CustomTable string

	// Allows you to specify a custom http.Client
	Client http.Client
}
The Client struct represents a connection to a Log Analytics instance.

Example:

client := loganalytics.Client{
	WorkspaceID: WORKSPACE,
	SharedKey:   SHARED_KEY,
	CustomTable: "foo",
}
result, err := client.Log(struct {
	Foo string `json:"foo"`
}{Foo: "this will show up in the foo table, under the foo column"})

if err != nil {
	log.Fatalln(err)
}
fmt.Println(result.Status)

func (*Client) Log

func (c *Client) Log(object any) (*http.Response, error)

Send a log entry to Log Analytics

Jump to

Keyboard shortcuts

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