RalapZ edited a comment on issue #5276: URL: https://github.com/apache/apisix/issues/5276#issuecomment-946739822
> we have test cases covering this case: > > https://github.com/apache/apisix/blob/50fed630823bb3c562f411d7cb5f5d38218348fb/t/plugin/traffic-split2.t#L593-L710 > > > {"datetime":"19/Oct/2021:08:11:33 +0800","remote_addr": "10.49.0.248","http_host": "myzone.ak.xyz","upstream_addr": "10.49.0.248:22","request_method": "GET","http_referer": "-","req_id": "10008","company_id": "-","zid": "-","status": "009","server_name": "_","request_uri": "/","http_user_agent": "curl/7.29.0","http_x_forwarded_for": "-","body_bytes_sent": "0","upstream_response_time": "0.008","request_time": "0.009"} > > What kind of log is this? And according to the logs I found some suspicions: > > the matching conditions are > > ``` > [ > "http_x_ak_request_id", > "==", > "10008" > ] > ``` > > but the header in request is `req_id`? `http_x_ak_request_id` match the `x-ak-request-id` in header, take a look at:https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/traffic-split.md#matching-rules-correspond-to-upstream this is log format --- access_log_format: '{"datetime":"$time_local","remote_addr": "$remote_addr","http_host": "$http_host","upstream_addr": "$upstream_addr","request_method": "$request_method","http_referer": "$http_referer","req_id": "$http_x_ak_request_id","company_id": "$http_x_ak_company_id","zid": "$http_zid","status": "$status","server_name": "$server_name","request_uri": "$request_uri","http_user_agent": "$http_user_agent","http_x_forwarded_for": "$http_x_forwarded_for","body_bytes_sent": "$body_bytes_sent","upstream_response_time": "$upstream_response_time","request_time": "$request_time"}' ---- req_id is key in my logformat; but value is "http_x_ak_request_id" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
