ListSyslogs

Updated at:

Queries system logs.

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

eflo:ListSyslogs

list

*Cluster

acs:eflo:{#regionId}:{#accountId}:node/{#NodeId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ToTime

string

Yes

The end time. Specify a UNIX timestamp in seconds.

1665369329

Query

string

No

The query condition.

*

Reverse

boolean

No

Specifies whether to query logs in reverse chronological order.

true

NextToken

string

No

The token for the next page. Include this token when you retrieve the next page of results.

392e8b4a03ed171433cc39f5b464ec9d

NodeId

string

Yes

The node ID.

e01-cn-nwy37atbj44

FromTime

string

Yes

The start time. Specify a UNIX timestamp in seconds.

1659745800

Response elements

Element

Type

Description

Example

object

RequestId

string

Id of the request

2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1

NextToken

string

The NextToken for the next page. Include this value in the request to retrieve the next page of results.

563d42ae0b17572449ec8c97f7f66069

Logs

array<object>

The paginated list of log objects.

object

The log object.

ClusterId

string

The cluster ID.

i119583961673208491760

Domain

string

The security domain of the client.

ALIYUN_PUBLIC

Facility

string

The Linux syslog standard field.

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 syslog content.

bond4: failed to get link speed/duplex for eth8

NodeId

string

The node ID.

e01-cn-9lb36u4s601

Severity

string

The Linux syslog standard field.

warning

Sn

string

The unique identifier of the machine.

21A401332

Source

string

The hostname of the syslog server.

damo-m53kr8kd-0008

Syslogtag

string

The Linux syslog standard field.

kernel

TagHostname

string

The tag for the hostname.

damo-m53kr8kd-0008

TagPackId

string

The tag for the pack ID.

D990314D3C25D7E8-1080

TagPath

string

The tag for the path.

/var/log/kern

TagReceiveTime

string

The tag for the receive time. Specify a UNIX timestamp in seconds.

1687363348

TagUserDefinedId

string

The tag for the user-defined ID.

application_b

Time

string

The time in UNIX timestamp format.

1687363346

Topic

string

The topic, which is logserver or log2sls. Both are syslog servers. logserver collects logs over TCP, and log2sls collects logs 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.