Log Field Descriptions

This document provides explanations for the various fields in the log content reported by Logstash.

CN Audit Logs

Field Descriptions

Field Group Field Name Description
fields instance_id Instance name.
node_name Name of the node where the compute node pod is located.
log_type Type of log.
pod_name Name of the compute node pod.
message log_time Timestamp when the log was printed.
physical_affected_rows Number of physically affected rows.
total_physical_get_connection_time_cost Time cost of obtaining a physical connection, in ns.
sql The executed SQL statement.
fetched_rows Number of records fetched from storage.
total_physical_time_cost Total physical execution time, including time cost of physical SQL and result set, in ns.
total_physical_sql_execution_time_cost Total time cost of physical SQL execution, in ns.
schema Database schema.
logical_time_cost Logical layer execution time cost (CPU time consumed by DRDS layer), in ns.
affected_rows For DML, the number of rows affected; for queries, the number of rows in the returned result set.
logical_optimizer_time_cost Time from receiving the SQL to generating the Plan, i.e., total time cost in the optimizer, in ns.
logical_executor_time_cost Total logical time cost to execute the entire plan (this metric excludes the total time cost of the physical layer), in ns.
workload_type The workload type during SQL execution, range of values as follows: TP - transactional workload; AP - analytical workload.
response_time Response time, in microseconds.
template_id Hash value of the template SQL.
user Username that executed the SQL.
trace_id TRACE ID for SQL execution.
extra_info Additional information, including client address (ipport), prepared statement number (stmt_id), transaction strategy (trx), workload type (wt), and kernel version (ver).

Example

{
  "_index": "cn_sql_log-2022.11.16",
  "_type": "_doc",
  "_id": "oz1rf4QB-sddlgYFeymE",
  "_version": 1,
  "_score": null,
  "_source": {
    "@version": "1",
    "@timestamp": "2022-11-16T07:50:58.507Z",
    "host": {
      "name": "filebeat-vtggm"
    },
    "fields": {
      "pod_name": "busu-pxchostnet-ql8p-cn-default-84cdc67d84-4w8ww",
      "log_type": "cn_sql_log",
      "instance_id": "busu-pxchostnet",
      "node_name": "cn-beijing.192.168.1.250"
    },
    "message": {
      "total_physical_sql_execution_time_cost": 680097,
      "total_physical_get_connection_time_cost": 4544,
      "fetched_rows": 0,
      "trace_id": "153a4ba63d007000",
      "extra_info": "ipport=192.168.0.3:58888 wt=TP ver=5.4.13-20220621",
      "affected_rows": 0,
      "template_id": "3e4e0512",
      "logical_time_cost": -3315586127,
      "user": "polardbx_root",
      "response_time": 1203,
      "physical_affected_rows": 0,
      "schema": "polardbx",
      "logical_optimizer_time_cost": 27655,
      "log_time": "2022-11-16 15:50:58.509",
      "sql": "SELECT engine, external_endpoint, file_uri, access_key_id, access_key_secret FROM metadb.file_storage_info",
      "total_physical_time_cost": 686243,
      "logical_executor_time_cost": -3315613782
    },
    "tags": [
      "beats_input_codec_plain_applied"
    ]
  },
  "fields": {
    "@timestamp": [
      "2022-11-16T07:50:58.507Z"
    ]
  },
  "sort": [
    1668585058507
  ]
}

CN Slow Logs

Field Descriptions

Field Group Field Name Description
fields instance_id Instance name.
log_type Type of log.
node_name Name of the node where the compute node pod is located.
pod_name Name of the compute node pod.
message log_time Time when the log was printed.
time Execution time, in milliseconds (ms).
host Client IP address.
port Client port.
sql Executed SQL statement.
affected_rows Number of affected rows.
trace_id Trace identifier.
server_version Kernel version.
user Username.
schema Database name.

Example

{
  "_index": "cn_slow_log-2022.08.09",
  "_type": "_doc",
  "_id": "CxdugYIB4-sIO7p8dvv-",
  "_version": 1,
  "_score": null,
  "_source": {
    "fields": {
      "instance_id": "busu-pxchostnet",
      "node_name": "cn-beijing.192.168.0.207",
      "log_type": "cn_slow_log",
      "pod_name": "busu-pxchostnet-ldcw-cn-default-c754df994-xqhhj"
    },
    "@version": "1",
    "message": {
      "log_time": "2022-08-09 15:07:55.720",
      "time": "2001",
      "host": "127.0.0.1",
      "port": "35812",
      "sql": "select sleep(2)",
      "affected_rows": "1",
      "trace_id": "14bacc6508402000",
      "server_version": "5.4.13-16534775",
      "user": "polardbx_root",
      "schema": "busudb"
    },
    "host": {
      "name": "filebeat-wg47m"
    },
    "@timestamp": "2022-08-09T07:07:55.720Z",
    "tags": [
      "beats_input_codec_plain_applied"
    ]
  },
  "fields": {
    "@timestamp": [
      "2022-08-09T07:07:55.720Z"
    ]
  },
  "highlight": {
    "message.schema": [
      "@kibana-highlighted-field@busudb@/kibana-highlighted-field@"
    ]
  },
  "sort": [
    1660028875720
  ]
}

CN Error Logs

Field Descriptions

Field Group Field Name Description
fields instance_id Instance name.
log_type Type of log.
node_name Name of the node where the compute node pod is located.
pod_name Name of the compute node pod.
/ logger Name of the logger.
loglevel Log level.
message Error message.
thread Thread name.

Example

{
  "_index": "cn_tddl_log-2022.08.09",
  "_type": "_doc",
  "_id": "3oWGgYIBMBS_DyGstwZ2",
  "_version": 1,
  "_score": null,
  "_source": {
    "loglevel": "WARN",
    "thread": "ManagerExecutor-14-thread-160",
    "logger": " com.alibaba.polardbx.manager.ManagerConnection",
    "host": {
      "name": "filebeat-wg47m"
    },
    "message": "[user=polardbx_root,host=127.0.0.1,port=37150,schema=null] Index: 17, Size: 17\njava.lang.IndexOutOfBoundsException: Index: 17, Size: 17\n\tat java.util.ArrayList.rangeCheck(ArrayList.java:659)\n\tat java.util.ArrayList.get(ArrayList.java:435)\n\tat com.alibaba.polardbx.net.packet.RowDataPacket.getPacketLength(RowDataPacket.java:111)\n\tat com.alibaba.polardbx.net.packet.RowDataPacket.write(RowDataPacket.java:85)\n\tat com.alibaba.polardbx.manager.response.ShowHtc.execute(ShowHtc.java:130)\n\tat com.alibaba.polardbx.manager.handler.ShowHandler.handle(ShowHandler.java:93)\n\tat com.alibaba.polardbx.manager.ManagerQueryHandler.query(ManagerQueryHandler.java:68)\n\tat com.alibaba.polardbx.net.handler.QueryHandler.queryRaw(QueryHandler.java:29)\n\tat com.alibaba.polardbx.net.FrontendConnection.query(FrontendConnection.java:474)\n\tat com.alibaba.polardbx.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:65)\n\tat com.alibaba.polardbx.manager.ManagerConnection.lambda$handleData$0(ManagerConnection.java:62)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:855)\n\tat com.alibaba.wisp.engine.WispTask.runOutsideWisp(WispTask.java:299)\n\tat com.alibaba.wisp.engine.WispTask.runCommand(WispTask.java:274)\n\tat com.alibaba.wisp.engine.WispTask.access$100(WispTask.java:53)\n\tat com.alibaba.wisp.engine.WispTask$CacheableCoroutine.run(WispTask.java:241)\n\tat java.dyn.CoroutineBase.startInternal(CoroutineBase.java:62)",
    "fields": {
      "instance_id": "busu-pxchostnet",
      "node_name": "cn-beijing.192.168.0.207",
      "log_type": "cn_tddl_log",
      "pod_name": "busu-pxchostnet-ldcw-cn-default-c754df994-xqhhj"
    },
    "@version": "1",
    "tags": [
      "beats_input_codec_plain_applied"
    ],
    "@timestamp": "2022-08-09T07:34:16.157Z"
  },
  "fields": {
    "@timestamp": [
      "2022-08-09T07:34:16.157Z"
    ]
  },
  "sort": [
    1660030456157
  ]
}

DN Audit Logs

Field Descriptions

Field Group Field Name Description
fields instance_id Instance name.
dn_instance_id Xstore name.
log_type Type of log.
node_name Name of the node where the data node pod is located.
pod_name Name of the data node pod.
/ version RDS audit log version.
thread_id Thread ID.
host_or_ip Hostname or IP address.
db Database used for the query.
start_utime Timestamp when the query started, in microseconds (us).
transaction_utime Transaction execution time, in microseconds (us).
error_code Error code.
time_cost_us Query execution time cost, in microseconds (us).
send_rows Number of rows returned by the query.
updated_rows Number of rows updated by the query.
examined_rows Number of rows scanned by the query.
memory_used Amount of memory used.
memory_used_by_query Amount of memory used during query execution.
logical_read Number of logical reads during the query execution.
physical_sync_read Number of synchronous physical reads during query execution.
physical_async_read Number of asynchronous physical reads during query execution.
temp_user_table_size Size of temporary user tables.
temp_sort_table_size Size of temporary sort tables.
temp_sort_file_size Size of temporary sort files.
sql_command SQL command, represented as an integer.
is_super Whether the querying user is a superuser.
lock_wait_time_us Time spent waiting for locks by the query, in microseconds (us).
log_message SQL command executed by the query.

ClickSQL Audit Pluginto view the format of the audit logs.

Example

{
  "@timestamp": [
    "2023-08-22T08:21:02.865Z"
  ],
  "@version": [
    "1"
  ],
  "@version.keyword": [
    "1"
  ],
  "db": [
    "null"
  ],
  "db.keyword": [
    "null"
  ],
  "error_code": [
    0
  ],
  "examined_rows": [
    1
  ],
  "fields.dn_instance_id": [
    "pxc-yd-1-jk87-gms"
  ],
  "fields.dn_instance_id.keyword": [
    "pxc-yd-1-jk87-gms"
  ],
  "fields.instance_id": [
    "pxc-yd-1"
  ],
  "fields.instance_id.keyword": [
    "pxc-yd-1"
  ],
  "fields.log_type": [
    "dn_audit_log"
  ],
  "fields.log_type.keyword": [
    "dn_audit_log"
  ],
  "fields.node_name": [
    "cn-zhangjiakou.10.0.0.72"
  ],
  "fields.node_name.keyword": [
    "cn-zhangjiakou.10.0.0.72"
  ],
  "fields.pod_name": [
    "pxc-yd-1-jk87-gms-log-0"
  ],
  "fields.pod_name.keyword": [
    "pxc-yd-1-jk87-gms-log-0"
  ],
  "host_or_ip": [
    "localhost"
  ],
  "host_or_ip.keyword": [
    "localhost"
  ],
  "host.name": [
    "filebeat-c2lpd"
  ],
  "host.name.keyword": [
    "filebeat-c2lpd"
  ],
  "is_super": [
    1
  ],
  "lock_wait_time_us": [
    82
  ],
  "log_message": [
    "SELECT ROLE, SERVER_READY_FOR_RW FROM information_schema.ALISQL_CLUSTER_LOCAL"
  ],
  "log_message.keyword": [
    "SELECT ROLE, SERVER_READY_FOR_RW FROM information_schema.ALISQL_CLUSTER_LOCAL"
  ],
  "logical_read": [
    0
  ],
  "memory_used": [
    0
  ],
  "memory_used_by_query": [
    0
  ],
  "physical_async_read": [
    0
  ],
  "physical_sync_read": [
    0
  ],
  "send_rows": [
    1
  ],
  "sql_command": [
    0
  ],
  "start_utime": [
    1692692462865465
  ],
  "tags": [
    "beats_input_codec_plain_applied"
  ],
  "tags.keyword": [
    "beats_input_codec_plain_applied"
  ],
  "temp_sort_file_size": [
    0
  ],
  "temp_sort_table_size": [
    0
  ],
  "temp_user_table_size": [
    0
  ],
  "thread_id": [
    285512
  ],
  "time_cost_us": [
    179
  ],
  "transaction_utime": [
    0
  ],
  "updated_rows": [
    0
  ],
  "user": [
    "root"
  ],
  "user.keyword": [
    "root"
  ],
  "version": [
    "MYSQL_V1"
  ],
  "version.keyword": [
    "MYSQL_V1"
  ],
  "_id": "EkZVHIoBThSFx_rRSm7n",
  "_index": "dn_audit_log-2023.08.22",
  "_score": null
}

DN Slow Logs

Field Descriptions

Field Group Field Name Description
fields instance_id Instance name.
dn_instance_id Xstore name.
log_type Type of log.
node_name Name of the node where the data node pod is located.
pod_name Name of the data node pod.
/ start_time Time when the query started.
user_host User and host name that executed the query.
query_time_us Time taken to execute the query, in microseconds (us).
lock_time_us Time spent waiting for locks by the query, in microseconds (us).
rows_sent Number of rows returned by the query.
rows_examined Number of rows scanned by the query.
db Database used for the query.
last_insert_id ID generated by the last insert operation.
insert_id ID generated by the current query.
server_id Server ID.
sql_text Text of the query statement.
thread_id Thread ID that executed the query.

You can view each field in the slow_log table in the mysql database. The query_time and lock_time are converted to integers in microseconds and stored in query_time_us and lock_time_us respectively.

Example

{
  "@timestamp": [
    "2023-08-22T08:28:42.516Z"
  ],
  "@version": [
    "1"
  ],
  "@version.keyword": [
    "1"
  ],
  "db": [
    ""
  ],
  "db.keyword": [
    ""
  ],
  "fields.dn_instance_id": [
    "pxc-yd-1-jk87-dn-0"
  ],
  "fields.dn_instance_id.keyword": [
    "pxc-yd-1-jk87-dn-0"
  ],
  "fields.instance_id": [
    "pxc-yd-1"
  ],
  "fields.instance_id.keyword": [
    "pxc-yd-1"
  ],
  "fields.log_type": [
    "dn_slow_log"
  ],
  "fields.log_type.keyword": [
    "dn_slow_log"
  ],
  "fields.node_name": [
    "cn-zhangjiakou.10.0.0.73"
  ],
  "fields.node_name.keyword": [
    "cn-zhangjiakou.10.0.0.73"
  ],
  "fields.pod_name": [
    "pxc-yd-1-jk87-dn-0-cand-1"
  ],
  "fields.pod_name.keyword": [
    "pxc-yd-1-jk87-dn-0-cand-1"
  ],
  "host.name": [
    "filebeat-tvlxq"
  ],
  "host.name.keyword": [
    "filebeat-tvlxq"
  ],
  "insert_id": [
    0
  ],
  "last_insert_id": [
    0
  ],
  "lock_time_us": [
    0
  ],
  "query_time_us": [
    2000206
  ],
  "rows_examined": [
    0
  ],
  "rows_sent": [
    1
  ],
  "server_id": [
    3169933882
  ],
  "sql_text": [
    "select sleep(2)"
  ],
  "sql_text.keyword": [
    "select sleep(2)"
  ],
  "start_time": [
    "2023-08-22 16:28:42.516694"
  ],
  "start_time.keyword": [
    "2023-08-22 16:28:42.516694"
  ],
  "tags": [
    "beats_input_codec_plain_applied"
  ],
  "tags.keyword": [
    "beats_input_codec_plain_applied"
  ],
  "thread_id": [
    1276945
  ],
  "user_host": [
    "root[root] @ localhost [127.0.0.1]"
  ],
  "user_host.keyword": [
    "root[root] @ localhost [127.0.0.1]"
  ],
  "_id": "SF1fHIoBThSFx_rRBfoo",
  "_index": "dn_slow_log-2023.08.22",
  "_score": null
}

DN Error Logs

Field Descriptions

Field Group Field Name Description
fields instance_id Instance name.
dn_instance_id Xstore name.
log_type Type of log.
node_name Name of the node where the data node pod is located.
pod_name Name of the data node pod.
/ thread Thread number, can be empty.
label Log level.
error_code Error code, can be empty.
subsystem Subsystem component, can be empty.
log_msg Error message content.

The format of logs varies with MySQL version and log level, so some fields may be empty, which indicates the field does not exist rather than having an empty value.

Example

{
  "@timestamp": [
    "2023-08-22T08:44:02.571Z"
  ],
  "@version": [
    "1"
  ],
  "@version.keyword": [
    "1"
  ],
  "error_code": [
    "MY-011825"
  ],
  "error_code.keyword": [
    "MY-011825"
  ],
  "fields.dn_instance_id": [
    "ddd-w58x-dn-0"
  ],
  "fields.dn_instance_id.keyword": [
    "ddd-w58x-dn-0"
  ],
  "fields.instance_id": [
    "ddd"
  ],
  "fields.instance_id.keyword": [
    "ddd"
  ],
  "fields.log_type": [
    "dn_error_log"
  ],
  "fields.log_type.keyword": [
    "dn_error_log"
  ],
  "fields.node_name": [
    "cn-zhangjiakou.10.0.0.73"
  ],
  "fields.node_name.keyword": [
    "cn-zhangjiakou.10.0.0.73"
  ],
  "fields.pod_name": [
    "ddd-w58x-dn-0-cand-1"
  ],
  "fields.pod_name.keyword": [
    "ddd-w58x-dn-0-cand-1"
  ],
  "host.name": [
    "filebeat-tvlxq"
  ],
  "host.name.keyword": [
    "filebeat-tvlxq"
  ],
  "label": [
    "Warning"
  ],
  "label.keyword": [
    "Warning"
  ],
  "log_msg": [
    "   [GTID INFO] Reading from undo log :ff49d04c-3130-11ee-83a6-00163e0b0612:9245515-9245517"
  ],
  "log_msg.keyword": [
    "   [GTID INFO] Reading from undo log :ff49d04c-3130-11ee-83a6-00163e0b0612:9245515-9245517"
  ],
  "subsystem": [
    "InnoDB"
  ],
  "subsystem.keyword": [
    "InnoDB"
  ],
  "tags": [
    "beats_input_codec_plain_applied"
  ],
  "tags.keyword": [
    "beats_input_codec_plain_applied"
  ],
  "thread": [
    1
  ],
  "_id": "fHJqHIoBThSFx_rRZvF0",
  "_index": "dn_error_log-2023.08.22",
  "_score": null
}

results matching ""

    No results matching ""