# Put log_format inside your http context. escape=json is important. # Choose your own log destination; do not replace existing logs blindly. log_format request_sieve escape=json '{"epoch":$msec,"host":"$host","uri":"$request_uri",' '"status":$status,"method":"$request_method"}'; # In the desired server context, after defining the format above: # access_log /var/log/nginx/request-sieve.jsonl request_sieve;