-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Kibana version: 7.10
Describe the bug:
When JSON logging is enabled, every single 'response' object shows a content length of 9 bytes.
Example:
{"type":"response","@timestamp":"2020-10-14T10:24:34-04:00","tags":[],"pid":30092,"method":"get","statusCode":200,"req":{"url":"/internal/spaces/_active_space","method":"get","headers":{"host":"black-box.local:5603","connection":"keep-alive","kbn-version":"8.0.0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36","content-type":"application/json","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://black-box.local:5603/joe/app/home","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9"},"remoteAddress":"10.0.0.120","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36","referer":"https://black-box.local:5603/joe/app/home"},"res":{"statusCode":200,"responseTime":16,"contentLength":9},"message":"GET /internal/spaces/_active_space 200 16ms - 9.0B"}Note the end of the line:
"contentLength":9},"message":"GET /internal/spaces/_active_space 200 16ms - 9.0B"}
However, when viewing that response in my browser's dev tools, it shows a content-length header of 134.
Steps to reproduce:
- Enable
logging.json: trueandlogging.verbose: truein your kibana.yml and start Kibana - Use a web browser to navigate to Kibana and log in
- Examine the JSON logs
Expected behavior: The JSON logs should reflect the actual content length of the response.
Any additional context:
-
Looking at some older GitHub issues that happen to include JSON log output, it appears this bug has been present since at least as far back as 6.x.
-
It appears that these 'response' objects are not logged at all using the new platform logger's
jsonlayout, e.g., they will not show up in the target file if you use this config:
logging:
appenders:
file:
kind: file
path: data/kibana.log
layout:
kind: json
root:
appenders: [default, file]
level: tracehowever, they will still show in the console output:
server respons [11:30:13.496] GET /internal/spaces/_active_space 200 14ms - 9.0B