Skip to content

Dumper does not preserve the formatting in log_format #27

@FeiYing9

Description

@FeiYing9

I have a log_format like this:

    log_format main '{"@timestamp":"$time_iso8601",'
                    '"host":"$hostname",'
                    '"server_ip":"$server_addr",'
                    '"client_ip":"$remote_addr",'
                    '"remote_user":"$remote_user",'
                    '"xff":"$http_x_forwarded_for",'
                    '"domain":"$host",'
                    '"url":"$uri",'
                    '"referer":"$http_referer",'
                    '"args":"$args",'
                    '"upstream_response_time":"$upstream_response_time",'
                    '"request_time":"$request_time",'
                    '"request_method":"$request_method",'
                    '"status":"$status",'
                    '"size":"$body_bytes_sent",'
                    '"content_length":"$content_length",'
                    '"request_length":"$request_length",'
                    '"protocol":"$server_protocol",'
                    '"upstreamhost":"$upstream_addr",'
                    '"file_dir":"$request_filename",'
                    '"http_user_agent":"$http_user_agent",'
                    '"upstream_cache_status":"$upstream_cache_status",'
                    '"file_name":"$file_name"'
                    '}';

After the dump code ,the result is:

log_format main {@timestamp:, host:, server_ip:, client_ip:, remote_user:, xff:, domain:, url:, referer:, args:, upstream_response_time:, request_time:, request_method:, status:, size:, content_length:, request_length:, protocol:, upstreamhost:, file_dir:, http_user_agent:, upstream_cache_status:, file_name: };

Metadata

Metadata

Labels

v2issues that would be fixed in v2 only

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions