ListLogstashLog

Updated at:

Queries the logs of a Logstash instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

elasticsearch:ListLogstashLog

get

*Logstash

acs:elasticsearch:{#regionId}:{#accountId}:logstashes/{#logstashesId}

None None

Request syntax

GET /openapi/logstashes/{InstanceId}/search-log HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

ls-cn-v0h1kzca****

Request parameters

Parameter

Type

Required

Description

Example

type

string

Yes

The log type. Valid values:

  • LOGSTASH_INSTANCE_LOG: main log.

  • SEARCHSLOW: searching slow log.

  • INDEXINGSLOW: indexing slow log.

  • JVMLOG: GC log.

  • LOGSTASH_DEBUG_LOG: debug log.

LOGSTASH_INSTANCE_LOG

query

string

Yes

The keyword to query.

host:10.7.xx.xx AND level:info AND content:opening

beginTime

integer

No

The beginning of the time range to query logs. This value is a UNIX timestamp. Unit: milliseconds.

1531910852074

endTime

integer

No

The end of the time range to query logs. This value is a UNIX timestamp. Unit: milliseconds.

1531910852074

page

integer

No

The page number of the instance list. Default value: 1. Minimum value: 1. Maximum value: 200.

1

size

integer

No

The number of entries per page for the paged query. Default value: 20. Minimum value: 1. Maximum value: 100.

20

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

7F40EAA1-6F1D-4DD9-8DB8-C5F00C4E****

Result

array<object>

The returned result.

object

level

string

The log level. Valid values include trace, debug, info, warn, and error. GC logs do not have a level.

info

content

string

The detailed content of the log.

[logstash.outputs.fileextend] Opening file {:path=>\"/ssd/1/ls-cn-v0h1kzca****/logstash/logs/debug/test\"}

timestamp

integer

The timestamp when the log was generated. Unit: milliseconds.

1531985112420

instanceId

string

The instance ID.

ls-cn-v0h1kzca****

host

string

The IP address of the node that generated the log.

192.168.xx.xx

The response also contains the following parameters.

NameTypeExampleDescription
ResultStructThe returned result.
└timeString2020-07-22T16:58:00.506ZThe time when the log was generated.
HeadersStructThe response header information.
└X-Total-CountInteger1The number of returned logs.
Note

└ indicates a child parameter.

Examples

Success response

JSON format

{
  "RequestId": "7F40EAA1-6F1D-4DD9-8DB8-C5F00C4E****",
  "Result": [
    {
      "level": "info",
      "content": "[logstash.outputs.fileextend] Opening file {:path=>\\\"/ssd/1/ls-cn-v0h1kzca****/logstash/logs/debug/test\\\"}",
      "timestamp": 1531985112420,
      "instanceId": "ls-cn-v0h1kzca****",
      "host": "192.168.xx.xx"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.