"github.com/volcengine/volc-sdk-golang/service/tls"
client := tls.NewClient(os.Getenv("VOLCENGINE_ENDPOINT"), os.Getenv("VOLCENGINE_ACCESS_KEY_ID"),
os.Getenv("VOLCENGINE_ACCESS_KEY_SECRET"), os.Getenv("VOLCENGINE_TOKEN"), os.Getenv("VOLCENGINE_REGION"))
createProjectResp, err := client.CreateProject(&tls.CreateProjectRequest{
ProjectName: "project-name",
Description: "project-description",
Region: os.Getenv("VOLCENGINE_REGION"),
fmt.Println(err.Error())
projectID := createProjectResp.ProjectID
createTopicResp, err := client.CreateTopic(&tls.CreateTopicRequest{
TopicName: "topic-name",
Description: "topic-description",
fmt.Println(err.Error())
topicID := createTopicResp.TopicID
_, err = client.CreateIndex(&tls.CreateIndexRequest{
FullText: &tls.FullTextInfo{
KeyValue: &[]tls.KeyValueInfo{
fmt.Println(err.Error())
_, err = client.PutLogsV2(&tls.PutLogsV2Request{
Source: "your-log-source",
FileName: "your-log-filename",
Contents: []tls.LogContent{
Contents: []tls.LogContent{
fmt.Println(err.Error())
time.Sleep(30 * time.Second)
resp, err := client.SearchLogsV2(&tls.SearchLogsRequest{
StartTime: 1346457600000,
fmt.Println(err.Error())
fmt.Println(resp.Status)
fmt.Println(resp.HitCount)
fmt.Println(resp.Analysis)