diff --git a/docs/blog/posts/log.md b/docs/blog/posts/log.md index 5192f0d..fceff12 100644 --- a/docs/blog/posts/log.md +++ b/docs/blog/posts/log.md @@ -91,4 +91,13 @@ recorders: "sid":"crk3evaohhhk8lipb8qg"} ``` -通过这些数据可以更加方便的统计和分析请求的状态。更进一步,可以在记录器服务中基于实时的状态数据进行业务扩展,例如之前提到的[动态分流功能](https://gost.run/blog/2022/dynamic-bypass/)等。 \ No newline at end of file +通过这些数据可以更加方便的统计和分析请求的状态。更进一步,可以在记录器服务中基于实时的状态数据进行业务扩展,例如之前提到的[动态分流功能](https://gost.run/blog/2022/dynamic-bypass/)等。 + +你也可以选择直接使用[gost-plugins](https://github.com/ginuerzh/gost-plugins)中的记录器插件服务,其会将接收到的记录数据保存在MongoDB数据库中或推送给Loki服务。 + + +![Loki - HTTP](../../images/loki01.png) + +![Loki - DNS](../../images/loki02.png) + + diff --git a/docs/concepts/recorder.md b/docs/concepts/recorder.md index 398d1e9..ada1ef2 100644 --- a/docs/concepts/recorder.md +++ b/docs/concepts/recorder.md @@ -80,13 +80,18 @@ recorders: http: url: http://192.168.1.1:80 timeout: 10s + header: + foo: bar ``` `http.url` (string) -: HTTP URL地址 +: HTTP URL地址。 `http.timeout` (duration) -: 请求超时时长 +: 请求超时时长。 + +`http.header` (object) +: 自定义HTTP请求头。 ### Redis @@ -192,7 +197,7 @@ services: ```json {"service":"service-0","network":"tcp", "remote":"[::1]:59234","local":"[::1]:8080", -"host":"www.example.com","client":"user1", +"host":"www.example.com","client":"user1","clientIP":"192.168.1.2", "http":{"host":"www.example.com","method":"GET","proto":"HTTP/1.1","scheme":"http","uri":"http://www.example.com/","statusCode":200, "request":{"contentLength":0,"header":{"Accept":["*/*"],"Proxy-Authorization":["Basic dXNlcjE6cGFzczE="],"Proxy-Connection":["Keep-Alive"],"User-Agent":["curl/8.5.0"]}}, "response":{"contentLength":1256,"header":{"Age":["525134"],"Cache-Control":["max-age=604800"],"Content-Length":["1256"],"Content-Type":["text/html; charset=UTF-8"],"Date":["Sat, 14 Sep 2024 01:56:59 GMT"],"Etag":["\"3147526947+ident\""],"Expires":["Sat, 21 Sep 2024 01:56:59 GMT"],"Last-Modified":["Thu, 17 Oct 2019 07:18:26 GMT"],"Server":["ECAcc (sac/2538)"],"Vary":["Accept-Encoding"],"X-Cache":["HIT"]}}}, diff --git a/docs/images/loki01.png b/docs/images/loki01.png new file mode 100644 index 0000000..56d3c85 Binary files /dev/null and b/docs/images/loki01.png differ diff --git a/docs/images/loki02.png b/docs/images/loki02.png new file mode 100644 index 0000000..c6f6ae0 Binary files /dev/null and b/docs/images/loki02.png differ diff --git a/en/docs/concepts/recorder.md b/en/docs/concepts/recorder.md index 18bfc61..43c6d37 100644 --- a/en/docs/concepts/recorder.md +++ b/en/docs/concepts/recorder.md @@ -80,6 +80,8 @@ recorders: http: url: http://192.168.1.1:80 timeout: 10s + header: + foo: bar ``` `http.url` (string) @@ -88,6 +90,9 @@ recorders: `timeout` (duration) : Timeout for establishing a connection +`http.header` (object) +: HTTP request header. + ### Redis Redis recorder records data to the redis server.