Queries all Logstores or Logstores that match specified conditions in a specified project.

Description

Host consists of a project name and a Log Service endpoint. You must specify a project in Host.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see Common request headers.

Request syntax

GET /logstores HTTP/1.1

Request parameters

Parameter Type Location Required Example Description
offset Integer Query No 0

The line from which the query starts. Default value: 0.

size Integer Query No 10

The number of entries to return on each page. Maximum value: 500. Default value: 500.

logstoreName String Query No my-logstore

The name of the Logstore. Fuzzy match is supported. For example, if you enter test, all Logstores whose name contains test are returned.

telemetryType String Query No None

The type of the log data that you want to query. Valid values:

  • None: queries all types of log data.
  • Metrics: queries metrics.
mode String Query No standard

The type of the Logstore. Log Service provides two types of Logstores: standard Logstores and query Logstores. Valid values:

  • standard: standard Logstore. This type of Logstore supports the log analysis feature and is suitable for scenarios such as real-time monitoring and interactive analysis. You can also use this type of Logstore to build a comprehensive observability system.
  • query: query Logstore. This type of Logstore supports high-performance queries. The index traffic fee of a query Logstore is approximately half that of a standard Logstore. Query Logstores do not support SQL analysis. Query Logstores are suitable for scenarios in which the volume of data is large, the log retention period is long, or log analysis is not required. Log retention periods of weeks or months are considered long.

Response parameters

Parameter Type Example Description
Server String nginx

The name of the server.

Content-Type String application/json

The content type of the response body.

Content-Length String 0

The length of the response body.

Connection String close

Indicates whether the connection is persistent. Valid values:

  • close: The connection is non-persistent. A new TCP connection is established for each HTTP request.
  • keep-alive: The connection is persistent. After a TCP connection is established, the connection remains open, and no more time or bandwidth is consumed to establish new connections.
Date String Sun, 27 May 2018 08:25:04 GMT

The time at which the response is returned.

x-log-requestid String 5B0A6B60BB6EE39764D458B5

The unique ID of the request. The ID is generated by Log Service.

total Integer 2

The number of the Logstores that meet the query conditions.

logstores Array of String test-1,test-2

The Logstore information.

Examples

Sample requests

GET /logstores?offset=0&size=10&logstoreName=my-logstore&telemetryType=None&mode=standard HTTP/1.1
Host:ali-test-project.cn-hangzhou.log.aliyuncs.com
Content-Type:application/json

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "total" : 2,
  "logstores" : [ "test-1,test-2" ]
}

Error codes

For a list of error codes, visit the API Error Center.

HTTP status code

Error code

Error message

Description

404

ProjectNotExist

Project does not exist.

The error message returned because the specified project does not exist.

500

InternalServerError

Specified Server Error Message.

The error message returned because an internal server error has occurred.

For more information, see Common error codes.