ListLogstashLog
Queries the logs of a Logstash instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:ListLogstashLog |
get |
*Logstash
|
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 |
| 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.
| Name | Type | Example | Description |
| Result | Struct | The returned result. | |
| └time | String | 2020-07-22T16:58:00.506Z | The time when the log was generated. |
| Headers | Struct | The response header information. | |
| └X-Total-Count | Integer | 1 | The number of returned logs. |
└ 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.