monitoring
This commit is contained in:
parent
4c0602ff39
commit
b83ad77f86
1 changed files with 3 additions and 5 deletions
|
@ -7,19 +7,17 @@
|
|||
settings = {
|
||||
namespaces = [{
|
||||
name = "nginx";
|
||||
format = ''$http_host: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'';
|
||||
format = ''$server_name: $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'';
|
||||
source.files = ["/var/log/nginx/access.log"];
|
||||
relabels = [
|
||||
{ name = "host"; from = "http_host"; }
|
||||
{ name = "request"; from = "request"; }
|
||||
{ name = "body_bytes_sent"; from = "body_bytes_sent"; }
|
||||
{ name = "host"; from = "server_name"; }
|
||||
];
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.commonHttpConfig = ''
|
||||
log_format combined2 "$http_host: $remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
|
||||
log_format combined2 "$server_name: $remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
|
||||
access_log /var/log/nginx/access.log combined2;
|
||||
'';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue