File tree Expand file tree Collapse file tree 6 files changed +65
-79
lines changed Expand file tree Collapse file tree 6 files changed +65
-79
lines changed Original file line number Diff line number Diff line change 76761 . 这是有关如何为特定路由启用kafka-logger插件的示例。
7777
7878``` shell
79- curl http://127.0.0.1:9080/apisix/admin/consumers -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
79+ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
8080{
81- "username": "foo",
8281 "plugins": {
8382 "kafka-logger": {
8483 "broker_list" :
Original file line number Diff line number Diff line change @@ -83,9 +83,8 @@ sample to take effect of this functionality.
8383The following is an example on how to enable the kafka-logger for a specific route.
8484
8585``` shell
86- curl http://127.0.0.1:9080/apisix/admin/consumers -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
86+ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
8787{
88- "username": "foo",
8988 "plugins": {
9089 "kafka-logger": {
9190 "broker_list" :
Original file line number Diff line number Diff line change 47471 . 下面例子展示了如何为指定路由开启 ` tcp-logger ` 插件的。
4848
4949``` shell
50- curl http://127.0.0.1:9080/apisix/admin/consumers -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
50+ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
5151{
52- "username": "foo",
53- "plugins": {
54- "plugins": {
55- "tcp-logger": {
56- "host": "127.0.0.1",
57- "port": 5044,
58- "tls": false
59- }
60- },
61- "upstream": {
62- "type": "roundrobin",
63- "nodes": {
64- "127.0.0.1:1980": 1
65- }
66- },
67- "uri": "/hello"
68- }
52+ "plugins": {
53+ "tcp-logger": {
54+ "host": "127.0.0.1",
55+ "port": 5044,
56+ "tls": false
57+ }
58+ },
59+ "upstream": {
60+ "type": "roundrobin",
61+ "nodes": {
62+ "127.0.0.1:1980": 1
63+ }
64+ },
65+ "uri": "/hello"
6966}'
7067```
7168
Original file line number Diff line number Diff line change @@ -53,27 +53,24 @@ This will provide the ability to send Log data requests as JSON objects to Monit
5353The following is an example on how to enable the tcp-logger for a specific route.
5454
5555``` shell
56- curl http://127.0.0.1:9080/apisix/admin/consumers -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
56+ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
5757{
58- "username": "foo",
59- "plugins": {
60- "plugins": {
61- "tcp-logger": {
62- "host": "127.0.0.1",
63- "port": 5044,
64- "tls": false,
65- "batch_max_size": 1,
66- "name": "tcp logger"
67- }
68- },
69- "upstream": {
70- "type": "roundrobin",
71- "nodes": {
72- "127.0.0.1:1980": 1
73- }
74- },
75- "uri": "/hello"
76- }
58+ "plugins": {
59+ "tcp-logger": {
60+ "host": "127.0.0.1",
61+ "port": 5044,
62+ "tls": false,
63+ "batch_max_size": 1,
64+ "name": "tcp logger"
65+ }
66+ },
67+ "upstream": {
68+ "type": "roundrobin",
69+ "nodes": {
70+ "127.0.0.1:1980": 1
71+ }
72+ },
73+ "uri": "/hello"
7774}'
7875```
7976
Original file line number Diff line number Diff line change 45451 . 下面例子展示了如何为指定路由开启 ` udp-logger ` 插件的。
4646
4747``` shell
48- curl http://127.0.0.1:9080/apisix/admin/consumers -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
48+ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
4949{
50- "username": "foo",
51- "plugins": {
52- "plugins": {
53- "tcp-logger": {
54- "host": "127.0.0.1",
55- "port": 5044,
56- "tls": false
57- }
58- },
59- "upstream": {
60- "type": "roundrobin",
61- "nodes": {
62- "127.0.0.1:1980": 1
63- }
64- },
65- "uri": "/hello"
66- }
50+ "plugins": {
51+ "tcp-logger": {
52+ "host": "127.0.0.1",
53+ "port": 5044,
54+ "tls": false
55+ }
56+ },
57+ "upstream": {
58+ "type": "roundrobin",
59+ "nodes": {
60+ "127.0.0.1:1980": 1
61+ }
62+ },
63+ "uri": "/hello"
6764}'
6865```
6966
Original file line number Diff line number Diff line change @@ -48,26 +48,23 @@ This will provide the ability to send Log data requests as JSON objects to Monit
4848The following is an example on how to enable the udp-logger for a specific route.
4949
5050``` shell
51- curl http://127.0.0.1:9080/apisix/admin/consumers -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
51+ curl http://127.0.0.1:9080/apisix/admin/routes/5 -H ' X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
5252{
53- "username": "foo",
54- "plugins": {
55- "plugins": {
56- "udp-logger": {
57- "host": "127.0.0.1",
58- "port": 3000,
59- "batch_max_size": 1,
60- "name": "udp logger"
61- }
62- },
63- "upstream": {
64- "type": "roundrobin",
65- "nodes": {
66- "127.0.0.1:1980": 1
67- }
68- },
69- "uri": "/hello"
70- }
53+ "plugins": {
54+ "udp-logger": {
55+ "host": "127.0.0.1",
56+ "port": 3000,
57+ "batch_max_size": 1,
58+ "name": "udp logger"
59+ }
60+ },
61+ "upstream": {
62+ "type": "roundrobin",
63+ "nodes": {
64+ "127.0.0.1:1980": 1
65+ }
66+ },
67+ "uri": "/hello"
7168}'
7269```
7370
You can’t perform that action at this time.
0 commit comments