mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 04:52:11 +00:00
improve nginx logging
This commit is contained in:
parent
a07918d149
commit
c611101987
3 changed files with 41 additions and 22 deletions
5
docker/elk/logstash/dist/http_output.conf
vendored
5
docker/elk/logstash/dist/http_output.conf
vendored
|
@ -645,11 +645,6 @@ filter {
|
||||||
date {
|
date {
|
||||||
match => [ "timestamp", "ISO8601" ]
|
match => [ "timestamp", "ISO8601" ]
|
||||||
}
|
}
|
||||||
mutate {
|
|
||||||
rename => {
|
|
||||||
"request" => "request_data"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tanner
|
# Tanner
|
||||||
|
|
5
docker/elk/logstash/dist/logstash.conf
vendored
5
docker/elk/logstash/dist/logstash.conf
vendored
|
@ -645,11 +645,6 @@ filter {
|
||||||
date {
|
date {
|
||||||
match => [ "timestamp", "ISO8601" ]
|
match => [ "timestamp", "ISO8601" ]
|
||||||
}
|
}
|
||||||
mutate {
|
|
||||||
rename => {
|
|
||||||
"request" => "request_data"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Tanner
|
# Tanner
|
||||||
|
|
51
docker/heimdall/dist/conf/nginx.conf
vendored
51
docker/heimdall/dist/conf/nginx.conf
vendored
|
@ -39,18 +39,47 @@ http {
|
||||||
# Logging Settings
|
# Logging Settings
|
||||||
##
|
##
|
||||||
|
|
||||||
log_format le_json '{ "timestamp": "$time_iso8601", '
|
log_format main_json escape=json '{'
|
||||||
'"src_ip": "$remote_addr", '
|
'"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution
|
||||||
'"remote_user": "$remote_user", '
|
'"connection_serial": "$connection", ' # connection serial number
|
||||||
'"body_bytes_sent": "$body_bytes_sent", '
|
'"connection_requests": "$connection_requests", ' # number of requests made in connection
|
||||||
'"request_time": "$request_time", '
|
'"pid": "$pid", ' # process pid
|
||||||
'"status": "$status", '
|
'"request_id": "$request_id", ' # the unique request id
|
||||||
'"request": "$request", '
|
'"request_length": "$request_length", ' # request length (including headers and body)
|
||||||
'"request_method": "$request_method", '
|
'"src_ip": "$remote_addr", ' # client IP
|
||||||
'"http_referrer": "$http_referer", '
|
'"remote_user": "$remote_user", ' # client HTTP username
|
||||||
'"http_user_agent": "$http_user_agent" }';
|
'"src_port": "$remote_port", ' # client port
|
||||||
|
'"time_local": "$time_local", '
|
||||||
|
'"time_iso8601": "$time_iso8601", ' # local time in the ISO 8601 standard format
|
||||||
|
'"request_data": "$request", ' # full path no arguments if the request
|
||||||
|
'"request_uri": "$request_uri", ' # full path and arguments if the request
|
||||||
|
'"args": "$args", ' # args
|
||||||
|
'"status": "$status", ' # response status code
|
||||||
|
'"body_bytes_sent": "$body_bytes_sent", ' # the number of body bytes exclude headers sent to a client
|
||||||
|
'"bytes_sent": "$bytes_sent", ' # the number of bytes sent to a client
|
||||||
|
'"http_referer": "$http_referer", ' # HTTP referer
|
||||||
|
'"http_user_agent": "$http_user_agent", ' # user agent
|
||||||
|
'"http_x_forwarded_for": "$http_x_forwarded_for", ' # http_x_forwarded_for
|
||||||
|
'"http_host": "$http_host", ' # the request Host: header
|
||||||
|
'"server_name": "$server_name", ' # the name of the vhost serving the request
|
||||||
|
'"request_time": "$request_time", ' # request processing time in seconds with msec resolution
|
||||||
|
'"upstream": "$upstream_addr", ' # upstream backend server for proxied requests
|
||||||
|
'"upstream_connect_time": "$upstream_connect_time", ' # upstream handshake time incl. TLS
|
||||||
|
'"upstream_header_time": "$upstream_header_time", ' # time spent receiving upstream headers
|
||||||
|
'"upstream_response_time": "$upstream_response_time", ' # time spend receiving upstream body
|
||||||
|
'"upstream_response_length": "$upstream_response_length", ' # upstream response length
|
||||||
|
'"upstream_cache_status": "$upstream_cache_status", ' # cache HIT/MISS where applicable
|
||||||
|
'"ssl_protocol": "$ssl_protocol", ' # TLS protocol
|
||||||
|
'"ssl_cipher": "$ssl_cipher", ' # TLS cipher
|
||||||
|
'"scheme": "$scheme", ' # http or https
|
||||||
|
'"request_method": "$request_method", ' # request method
|
||||||
|
'"server_protocol": "$server_protocol", ' # request protocol, like HTTP/1.1 or HTTP/2.0
|
||||||
|
'"pipe": "$pipe", ' # “p” if request was pipelined, “.” otherwise
|
||||||
|
'"gzip_ratio": "$gzip_ratio", '
|
||||||
|
'"http_cf_ray": "$http_cf_ray"'
|
||||||
|
'}';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log le_json;
|
access_log /var/log/nginx/access.log main_json;
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in a new issue