Help Center/ Log Tank Service/ API Reference/ APIs/ Log Stream Management/ Querying All Log Streams in a Specified Log Group
Updated on 2024-12-20 GMT+08:00

Querying All Log Streams in a Specified Log Group

Function

This API is used to query information about all log streams in a specified log group.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/groups/{log_group_id}/streams

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID.

Minimum: 32

Maximum: 32

log_group_id

Yes

String

Log group ID. For details about how to obtain a log group ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID.

Minimum: 36

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token.

Minimum: 1000

Maximum: 2000

Content-Type

Yes

String

Set this parameter to application/json;charset=UTF-8.

Minimum: 30

Maximum: 30

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

log_streams

Array of LogStreamResBody objects

Log stream.

Table 4 LogStreamResBody

Parameter

Type

Description

creation_time

Long

Creation time.

Minimum value: 1577808000000

Maximum value: 4102416000000

log_stream_id

String

Log stream ID.

Minimum: 36

Maximum: 36

log_stream_name

String

Log stream name.

Minimum: 1

Maximum: 64

log_stream_name_alias

String

Log stream alias.

tag

Map<String,String>

Log stream tags.

filter_count

Integer

Number of filters.

Minimum: 0

Maximum: 5

is_favorite

Boolean

Whether to add a log stream to favorites.

whether_log_storage

Boolean

Whether to enable log storage.

hot_cold_separation

Boolean

Whether to enable cold storage.

auth_web_tracking

Boolean

Anonymous write switch.

ttl_in_days

Integer

Storage duration.

hot_storage_days

Integer

Standard storage duration.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Querying All Log Streams in a Specified Log Group

GET https://{endpoint}/v2/{project_id}/groups/{log_group_id}/streams

/v2/{project_id}/groups/{log_group_id}/streams

Example Responses

Status code: 200

The request is successful.

{
  "log_streams" : [ {
    "log_stream_name_alias" : "3",
    "creation_time" : 1723102152593,
    "auth_web_tracking" : false,
    "log_stream_name" : "3",
    "is_favorite" : false,
    "hot_storage_days" : -1,
    "tag" : {
      "_sys_enterprise_project_id" : "0"
    },
    "hot_cold_separation" : false,
    "filter_count" : 0,
    "log_stream_id" : "667293b4-7f6d-4efb-9b30-xxxxxxx",
    "ttl_in_days" : -1,
    "whether_log_storage" : true
  }, {
    "log_stream_name_alias" : "5",
    "creation_time" : 1723102172632,
    "auth_web_tracking" : false,
    "log_stream_name" : "5",
    "is_favorite" : false,
    "hot_storage_days" : -1,
    "tag" : {
      "_sys_enterprise_project_id" : "0"
    },
    "hot_cold_separation" : false,
    "filter_count" : 0,
    "log_stream_id" : "fb08a859-69ed-4bbe-9ba0-xxxxxxxx",
    "ttl_in_days" : -1,
    "whether_log_storage" : true
  } ]
}

Status code: 401

AuthFailed. Authentication failed. Check the token and try again.

{
  "error_code" : "LTS.0003",
  "error_msg" : "Invalid token"
}

Status code: 403

Forbidden.The request has been rejected.The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.

{
  "error_code" : "LTS.0001",
  "error_msg" : "Invalid projectId"
}

Status code: 500

InternalServerError.

The server has received the request but encountered an internal error.

{
  "error_code" : "LTS.0010",
  "error_msg" : "The system encountered an internal error"
}

Status Codes

Status Code

Description

200

The request is successful.

401

AuthFailed. Authentication failed. Check the token and try again.

403

Forbidden.The request has been rejected.The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.

500

InternalServerError.

The server has received the request but encountered an internal error.

Error Codes

See Error Codes.