FastQuery Operations
Updated at:2025-11-03
Create fast query
To create the fast query instance name, the following guidelines must be met:
- Fast query names must be unique per account and per region.
- The fast query name shall not be longer than 128 characters
- Only these characters are permitted for fast query name:
a-z, A-Z, 0-9, '_', '-', '.'"
Use the following code to create a fast query.
Go
1createFastQueryRequest := CreateFastQueryRequest{
2 FastQueryName: "test",
3 Query: "match *",
4 Description: "",
5 Project: "defautl",
6 LogStoreName: "test",
7 StartDateTime: time.Now().UTC().Format("2006-01-02T15:04:05Z"),
8 EndDateTime: time.Now().UTC().Format("2006-01-02T15:04:05Z"),
9}
10err := BLS_CLIENT.CreateLogStoreV2(createLogStoreRequest)
11if err != nil {
12 fmt.Println("Create fastQuery failed: ", err)
13} else {
14 fmt.Println('Create fastQuery success.')
15}
Prompt:
- Detailed parameter configuration and restrictions may refer to BLS API document Create Fast Query
Obtain the specified fast query
With following codes, get the fast query details of the specified name
Go
1describeFastQueryRequest := DescribeFastQueryRequest{
2 FastQueryName: "test",
3}
4res, err := BLS_CLIENT.DescribeFastQueryV2(describeFastQueryRequest)
5if err != nil {
6 fmt.Println("Get fastQuery failed: ", err)
7} else {
8 fmt.Println("Fastquery info: ", res)
9}
Prompt:
- Detailed parameter configuration and restrictions may refer to BLS API document Describe Fast Query
Update the specified fast query
With following codes, update the fast query instance information of the specified name
Go
1updateFastQueryRequest := UpdateFastQueryRequest{
2 FastQueryName: "test",
3 Query: "select * limit 10",
4 Description: "test",
5 Project: "default",
6 LogStoreName: "test",
7 LogStreamName: "test",
8 StartDateTime: time.Now().UTC().Format("2006-01-02T15:04:05Z"),
9 EndDateTime: time.Now().UTC().Format("2006-01-02T15:04:05Z"),
10}
11err := BLS_CLIENT.UpdateFastQueryV2(updateFastQueryRequest)
12if err != nil {
13 fmt.Println("Update fastQuery failed: ", err)
14} else {
15 fmt.Println("Update fastQuery success.")
16}
Prompt:
- Detailed parameter configuration and restrictions may refer to BLS API document Update Fast Query
Get the fast query list
Use the following code to retrieve the list of fast queries saved by the current user.
Go
1//Optional parameter list
2listFastQueryRequest := ListFastQueryRequest{
3 Project: "default",
4 NamePattern: "m",
5 Order: "desc",
6 OrderBy: "",
7 PageNo: 1,
8 PageSize: 20,
9}
10res, err := BLS_CLIENT.ListFastQueryV2(listFastQueryRequest)
11if err != nil {
12 fmt.Println("List fastQuery failed: ", err)
13} else {
14 fmt.Println("FastQuery list: ", res)
15}
Prompt:
- Detailed parameter configuration and restrictions may refer to BLS API document List Fast Query
Delete the specified fast query
Use the following code to delete the fast query example with the specified name.
Go
1deleteFastQueryRequest := DeleteFastQueryRequest{
2 FastQueryName: "test",
3}
4err := BLS_CLIENT.DeleteFastQueryV2(deleteFastQueryRequest)
5if err != nil {
6 fmt.Println("Delete fastQuery failed: ", err)
7} else {
8 fmt.Println("Delete fastQuery success.")
9}
Prompt:
- Detailed parameter configuration and restrictions may refer to BLS API document Delete Fast Query
