Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to parse nginx json log #1747

Open
megadotnet opened this issue Apr 29, 2020 · 0 comments
Open

How to parse nginx json log #1747

megadotnet opened this issue Apr 29, 2020 · 0 comments

Comments

@megadotnet
Copy link

megadotnet commented Apr 29, 2020

Nginx logging config:

        log_format access-pro_json escape=json '{"@timestamp":"$time_iso8601",'
                '"server_addr":"$server_addr",'
                '"remote_addr":"$remote_addr",'
                '"http_x_forwarded_for":"$http_x_forwarded_for",'
                '"size":"$body_bytes_sent",'
                '"http_status":"$status",'
                '"domain_http_host":"$host",'
                '"request":"$request",'
                '"uri":"$uri",'
                '"referer":"$http_referer",'
                '"responsetime":"$request_time",'
                '"http_user_agent":"$http_user_agent",'
                '"upstream_response_time":"$upstream_response_time",'
                '"upstreamhost":"$upstream_addr",'
                '"upstreamstatus":"$upstream_status"}';

How to parse json log like following format:

{"@timestamp":"2020-04-28T00:00:41+08:00","server_addr":"10.252.185.197","remote_addr":"10.252.182.183","http_x_forwarded_for":"2409:8a55:e43b:d10:953:4116:ecc1:f563, 10.252.253.113","size":"39308","http_status":"200","domain_http_host":"x.x.x.cn","request":"GET /H5/jy/static/js/app.953eda21.js HTTP/1.1","uri":"/H5/jy/static/js/app.953eda21.js","referer":"http://x.x.x.cn/H5/jy/index.html","responsetime":"0.000","http_user_agent":"Mozilla/5.0 (Linux; Android 6.0.1; OPPO R9sk Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36 GDMobile/7.0.4","upstream_response_time":"","upstreamhost":"","upstreamstatus":""}

Could you give us to log_format config for goaccess?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants