Issue description
Add a request_body switch to the schema, and each body can be used by expr to decide whether to log or not. Without this switch, the body is not logged.
"kafka-logger": {
"broker_list":{
"127.0.0.1":9092
},
"kafka_topic" : "test2",
"request_body": {
"expr": [
["request_length", "<", "1024"],
]
},
"key" : "key1",
"batch_max_size": 1,
"name": "kafka logger"
}
expr can be evaluated by lua-resty-expr. request body can be fetched by core.request.get_body.
Environment
- apisix version (cmd:
apisix version): 2.10.1
- OS (cmd:
uname -a):
- OpenResty / Nginx version (cmd:
nginx -V or openresty -V):
- etcd version, if have (cmd: run
curl http://127.0.0.1:9090/v1/server_info to get the info from server-info API):
- apisix-dashboard version, if have:
- the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
- luarocks version, if the issue is about installation (cmd:
luarocks --version):
Issue description
Add a request_body switch to the schema, and each body can be used by expr to decide whether to log or not. Without this switch, the body is not logged.
exprcan be evaluated by lua-resty-expr. request body can be fetched by core.request.get_body.Environment
apisix version): 2.10.1uname -a):nginx -Voropenresty -V):curl http://127.0.0.1:9090/v1/server_infoto get the info from server-info API):luarocks --version):