2294648043 opened a new issue, #7396:
URL: https://github.com/apache/apisix/issues/7396

   ### Description
   
   Using the clickhouse-logger plugin to set request_time in the log format 
will report an error
   `*4290315 [lua] batch-processor.lua:95: Batch Processor[clickhouse-logger] 
failed to process entries: server returned status code[400] host[172.16.5.189] 
port[8133] body[Code: 26, e.displayText() = DB::ParsingException: Cannot parse 
JSON string: expected opening quote: (while reading the value of key 
request_time): (at row 1)`
   
   my log metadata format
   curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/clickhouse-logger -H 
'X-API-KEY: 4y6c4z9j9z8a6n9h9x3c7t9r1g7i9o5n' -X PUT -d '
   {
       "log_format": {
           "method": "$request_method",
           "unix_time":"$msec",
           "time_local": "$time_local",
           "request_time":"$request_time",
           "body_bytes_sent": "$body_bytes_sent",
           "http_host": "$http_host",
           "http_referrer": "$name",
           "http_user_agent": "$http_user_agent",
           "path": "$uri",
           "remote_addr": "$proxy_protocol_addr",
           "remote_user": "$remote_user",
           "request": "$request",
           "request_proto": "$server_protocol",
           "request_query": "$args",
           "time": "$time_iso8601",
           "upstream_addr": "$upstream_addr",
           "upstream_host": "$upstream_host",
           "upstream_scheme": "$upstream_scheme",
           "upstream_status": "$upstream_status",
           "upstream_uri": "$upstream_uri",
           "vhost": "$host",
           "x_forward_for": "$proxy_add_x_forwarded_for",
           "route_name":"$route_name"
       }
   }'
   
   If the request_time is removed, it can be used normally
   how to solve such a problem
   
   
   
   
   
   ### Environment
   
   - APISIX 2.14:
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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]

Reply via email to