udp-log
<p class="shortdesc">kong网关访问的日志写入到udp接口。</p>
<section class="section" id="udp-log__section_skp_4px_2sb"><h2 class="doc-tairway">配置参数说明</h2>
<div class="p">
<table class="table" id="udp-log__table_v3q_ppx_2sb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead">
<tr class="row">
<th class="entry align-left" id="udp-log__table_v3q_ppx_2sb__entry__1">参数名</th>
<th class="entry align-left" id="udp-log__table_v3q_ppx_2sb__entry__2">参数类型</th>
<th class="entry align-left" id="udp-log__table_v3q_ppx_2sb__entry__3">是否必须</th>
<th class="entry align-left" id="udp-log__table_v3q_ppx_2sb__entry__4">默认值</th>
<th class="entry align-left" id="udp-log__table_v3q_ppx_2sb__entry__5">参数说明</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__1 ">host</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__2 ">string</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__3 ">Y</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__4 "></td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__5 ">接口地址</td>
</tr>
<tr class="row">
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__1 ">port</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__2 ">number</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__3 ">Y</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__4 "></td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__5 ">端口</td>
</tr>
<tr class="row">
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__1 ">timeout</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__2 ">number</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__3 ">Y</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__4 ">10000</td>
<td class="entry align-left" headers="udp-log__table_v3q_ppx_2sb__entry__5 "></td>
</tr>
</tbody></table>
</div>
</section>
<section class="section" id="udp-log__section_oqg_qpx_2sb"><h2 class="doc-tairway">配置示例</h2>
<p class="p"><img class="image" id="udp-log__image_svf_5px_2sb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20220910180811-1023e6389098.png"></p>
</section>
<section class="section" id="udp-log__section_rp1_vpx_2sb"><h2 class="doc-tairway">日志内容</h2>
<div class="p">
<pre class="pre codeblock" id="udp-log__codeblock_h33_wpx_2sb"><code>{
"latencies": {
"request": 5, // Kong获取请求、接收数据、负载均衡、请求结果会写总时间
"kong": 1,
"proxy": 4 //代理服务等待时间
},
"service": { // 关联的代理服务配置
"host": "static-admin",
"created_at": 1570866418,
"connect_timeout": 60000,
"id": "7aec55eb-832e-42fc-ac45-ada88c1d8167",
"protocol": "http",
"name": "upstream",
"read_timeout": 60000,
"port": 80,
"path": "\/",
"updated_at": 1570866418,
"retries": 5,
"write_timeout": 60000
},
"request": { //请求内容
"querystring": {
"param": "value"
},
"size": "411",
"uri": "\/upstream?param=value",
"url": "http:\/\/30.99.140.133:80\/upstream?param=value",
"headers": {
"host": "30.99.140.133:30033",
"accept-encoding": "gzip, deflate",
"user-agent": "Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/71.0.3578.98 Safari\/537.36",
"connection": "keep-alive",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8",
"accept": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"upgrade-insecure-requests": "1"
},
"method": "GET"
},
"tries": [ // 如果配置了负载均衡,是负载均衡Target的请求记录
{
"balancer_latency": 0,
"port": 8001,
"balancer_start": 1571018380356,
"ip": "127.0.0.1"
}
],
"client_ip": "30.99.140.133",
"api": {},
"upstream_uri": "\/?param=value", //请求到后端代理服务的path
"response": { //请求结果
"headers": {
"content-type": "application\/json; charset=utf-8",
"date": "Mon, 14 Oct 2019 01:59:40 GMT",
"connection": "close",
"content-encoding": "gzip",
"via": "kong\/0.14.0",
"server": "kong\/0.14.0",
"transfer-encoding": "chunked",
"x-kong-proxy-latency": "1",
"x-kong-upstream-latency": "4",
"access-control-allow-origin": "*"
},
"status": 200,
"size": "3015"
},
"route": { // 关联的路由规则信息
"created_at": 1570866418,
"strip_path": true,
"hosts": null,
"preserve_host": false,
"regex_priority": 0,
"updated_at": 1570866418,
"paths": [
"\/upstream"
],
"service": {
"id": "7aec55eb-832e-42fc-ac45-ada88c1d8167"
},
"methods": null,
"protocols": [
"http",
"https"
],
"id": "d4584f5f-3778-4ef0-8cdc-afa878d26835"
},
"started_at": 1571018380355
}</code></pre>
</div>
</section>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!