All Products
Search
Document Center

Simple Log Service:Go SDK overview

Last Updated:Jun 03, 2026

Use the Go SDK to access all SLS API operations programmatically.

Releases

View the changelog and version history on GitHub.

Sample code

Available Go SDK samples:

Sample

Description

alert_example.go

Create alerts (legacy).

index_sample.go

Create an index, write logs, and query logs.

log_logstore.go

Create and modify a Logstore.

machine_group_sample.go

Associate a machine group with a Logtail configuration.

simple_demo.go

Use a consumer group to read data.

log_config_json.go

Create a Logtail configuration in JSON pattern.

main.go

Query logs.

client_alert_test.go

Create alerts (new).

client_alert_resource_test.go

Create alert resources (new).