Queries system logs.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ToTime |
string |
Yes |
The end time. |
1665369329 |
| Query |
string |
No |
The query condition. |
* |
| Reverse |
boolean |
No |
Specifies whether to sort the results by time in descending order. |
true |
| NextToken |
string |
No |
The token for the next page. To retrieve the next page of results, include the token in the next request. |
392e8b4a03ed171433cc39f5b464ec9d |
| NodeId |
string |
Yes |
The node ID. |
e01-cn-nwy37atbj44 |
| FromTime |
string |
Yes |
The start time. |
1659745800 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1 |
| NextToken |
string |
The `NextToken` for the next page. To retrieve the next page of results, include this return value in the next request. |
563d42ae0b17572449ec8c97f7f66069 |
| Logs |
array<object> |
The object that contains the paginated list of logs. |
|
|
object |
The log object. |
||
| ClusterId |
string |
The cluster ID. |
i119583961673208491760 |
| Domain |
string |
The security domain of the client. |
ALIYUN_PUBLIC |
| Facility |
string |
A standard field in Linux syslog. |
kern |
| Hostname |
string |
The hostname of the client. |
damo-m53kr8kd-0008 |
| Ip |
string |
The IP address of the client. |
114.55.254.44 |
| Msg |
string |
The content of the syslog. |
bond4: failed to get link speed/duplex for eth8 |
| NodeId |
string |
The node ID. |
e01-cn-9lb36u4s601 |
| Severity |
string |
A standard field in Linux syslog. |
warning |
| Sn |
string |
The unique identifier of the machine. |
21A401332 |
| Source |
string |
The hostname of the syslog server. |
damo-m53kr8kd-0008 |
| Syslogtag |
string |
A standard field in Linux syslog. |
kernel |
| TagHostname |
string |
Tag: Hostname. |
damo-m53kr8kd-0008 |
| TagPackId |
string |
Tag: Package ID. |
D990314D3C25D7E8-1080 |
| TagPath |
string |
Tag: Path. |
/var/log/kern |
| TagReceiveTime |
string |
Tag: Receive time. |
1687363348 |
| TagUserDefinedId |
string |
Tag: User-defined ID. |
application_b |
| Time |
string |
The time in UNIX format. |
1687363346 |
| Topic |
string |
The topic. Valid values are `logserver` and `log2sls`. Note: Both are syslog servers. `logserver` collects data over TCP. `log2sls` collects data over UDP. |
logserver |
Examples
Success response
JSON format
{
"RequestId": "2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1",
"NextToken": "563d42ae0b17572449ec8c97f7f66069",
"Logs": [
{
"ClusterId": "i119583961673208491760",
"Domain": "ALIYUN_PUBLIC",
"Facility": "kern",
"Hostname": "damo-m53kr8kd-0008",
"Ip": "114.55.254.44",
"Msg": "bond4: failed to get link speed/duplex for eth8",
"NodeId": "e01-cn-9lb36u4s601",
"Severity": "warning",
"Sn": "21A401332",
"Source": "damo-m53kr8kd-0008\n",
"Syslogtag": "kernel",
"TagHostname": "damo-m53kr8kd-0008\n",
"TagPackId": "D990314D3C25D7E8-1080",
"TagPath": "/var/log/kern",
"TagReceiveTime": "1687363348",
"TagUserDefinedId": "application_b",
"Time": "1687363346",
"Topic": "logserver"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.