云日志服务 LTS-APIG接入:结构化模板日志详情

时间:2024-05-13 14:31:40

结构化模板日志详情

  • 结构化模板示例
    表2 结构化模板示例

    模板名称

    示例日志

    APIG

    100.125.7.59 f57f6523b675504a23887d0f5c1c8ef3 f5ea2360a2fa443cac236b76f4052ad6 - - [27/Jan/2022:15:56:44 +0800] 0.113 GET http://c965898968af48248ec7fac4ec0666f4.apic.cn-north-4.huaweicloudapis.com /api/echo HTTP/1.1 200 1443 408 "APIGatewayDebugClient/1.0" "-" "100.125.2.39:443" /v2/x/fgs/functions/urn:fss:cn-north-4:106506b9a92342df9a5025fc12351cfc:function:default:apigDemo_1640743997661:latest/invocations "200" "0.010" "0.083" "0.083" cn-north-4 0.083 0 - - - 0.03000020980835 - - "-" 486 HttpEchoDemo - - - "-" "-" "-" "-" "-" "-" "-" "-" "-" "-" "remote" "0.52" "http" "id" "-" "urn:fss:cn-north-7:6650ff66e4524699bea4c96ff2f268fe:function:default:test123hxy"
  • 结构化字段详情

    表3 结构化字段

    字段

    示例

    描述

    类型

    my_remote_addr

    100.125.7.59

    用户的客户端IP地址

    string

    request_id

    f57f6523b675504a23887d0f5c1c8ef3

    请求ID

    string

    api_id

    f5ea2360a2fa443cac236b76f4052ad6

    API ID

    string

    user_id

    -

    用户名称

    string

    app_id

    -

    当使用APP认证访问时,请求方提供的APP ID

    string

    time_local

    27/Jan/2022:15:56:44

    请求时间

    string

    request_time

    0.113

    请求延迟

    float

    request_method

    GET

    HTTP请求方法

    string

    scheme

    http

    请求方式

    string

    host

    c965898968af48248ec7fac4ec0666f4.apic.cn-north-4.huaweicloudapis.com

    请求域名

    string

    router_uri

    /api/echo

    请求URI

    string

    server_protocol

    HTTP/1.1

    请求协议

    string

    status

    200

    响应状态码

    long

    bytes_sent

    1443

    响应大小(单位:字节,包含状态行、响应头、响应体)

    long

    request_length

    408

    请求长度(单位:字节,包含起始行、请求头、请求体)

    long

    http_user_agent

    APIGatewayDebugClient/1.0

    用户代理标识

    string

    http_x_forwarded_for

    -

    X-Forwarded-For头

    string

    upstream_addr

    100.125.2.39:443

    请求的后端地址

    string

    upstream_uri

    /v2/x/fgs/functions/urn:fss:cn-north-4:106506b9a92342df9a5025fc12351cfc:function:default:apigDemo_1640743997661:latest/invocations

    请求后端的URI

    string

    upstream_status

    200

    后端响应状态码

    long

    upstream_connect_time

    0.01

    与后端建立连接所用时间

    float

    upstream_header_time

    0.083

    从开始与后端建立连接到从后端获取到首字节所用时间

    float

    upstream_response_time

    0.083

    从开始与后端建立连接到从后端获取到最后一个字节所用时间

    float

    region_id

    cn-north-4

    云服务区ID

    string

    all_upstream_response_time

    0.083

    从开始与后端建立连接到从后端获取到最后一个字节所用时间,单位秒。发生重试时,为所用时间总和

    float

    errorType

    0

    API请求的错误类型

    • 0:非流控错误
    • 1:流控错误

    long

    auth_type

    -

    API认证类型

    string

    access_model1

    -

    认证模式1

    string

    access_model2

    -

    认证模式2,开启双重认证时,为自定义认证编号

    string

    inner_time

    0.03000020980835

    apig的内部处理时长,单位秒

    float

    proxy_protocol_vni

    -

    VPC终端节点的虚拟网络标识

    string

    proxy_protocol_vpce_id

    -

    VPC终端节点的ID

    string

    proxy_protocol_addr

    -

    客户端源IP地址

    string

    body_bytes_sent

    486

    API请求的Body体大小,单位字节

    long

    api_name

    HttpEchoDemo

    API名称

    string

    app_name

    -

    当使用APP认证访问时,请求方使用的APP名称

    string

    provider_app_id

    -

    API所属的APP ID

    string

    provider_app_name

    -

    API所属的APP名称

    string

    custom_data_log1

    -

    用户自定义日志字段值1

    string

    custom_data_log2

    -

    用户自定义日志字段值2

    string

    custom_data_log3

    -

    用户自定义日志字段值3

    string

    custom_data_log4

    -

    用户自定义日志字段值4

    string

    custom_data_log5

    -

    用户自定义日志字段值5

    string

    custom_data_log6

    -

    用户自定义日志字段值6

    string

    custom_data_log7

    -

    用户自定义日志字段值7

    string

    custom_data_log8

    -

    用户自定义日志字段值8

    string

    custom_data_log9

    -

    用户自定义日志字段值9

    string

    custom_data_log10

    -

    用户自定义日志字段值10

    string

    response_source

    remote

    请求响应来源

    • local:APIG
    • remote:后端服务

    string

    gzip_ratio

    0.52

    原始响应body体大小与压缩后大小的比率。

    float

    upstream_scheme

    http

    后端协议类型。

    string

    group_id

    id

    分组ID。

    string

    apig_err_code

    -

    网关错误码。

    string

    function_urn

    urn:fss:cn-north-7:6650ff66e4524699bea4c96ff2f268fe:function:default:test123hxy

    函数的URN。

    string

support.huaweicloud.com/usermanual-lts/lts_04_0506.html