From ebc9d34b789bd157a4b97abc1fae23de5ad63729 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Fri, 16 Jul 2021 15:24:00 +0200 Subject: [PATCH] graylog : update documentation --- terranix/graylog/nginx.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/terranix/graylog/nginx.nix b/terranix/graylog/nginx.nix index 5ba55ef..772a107 100644 --- a/terranix/graylog/nginx.nix +++ b/terranix/graylog/nginx.nix @@ -1,5 +1,31 @@ +/* + +# use this nginx configuration +# to send data to these inputs + +log_format graylog2_json escape=json '{ "timestamp": "$time_iso8601", ' + '"facility": "nginx", ' + '"src_addr": "$remote_addr", ' + '"body_bytes_sent": $body_bytes_sent, ' + '"request_time": $request_time, ' + '"response_status": $status, ' + '"request": "$request", ' + '"request_method": "$request_method", ' + '"host": "$host",' + '"upstream_cache_status": "$upstream_cache_status",' + '"upstream_addr": "$upstream_addr",' + '"http_x_forwarded_for": "$http_x_forwarded_for",' + '"http_referrer": "$http_referer", ' + '"http_user_agent": "$http_user_agent" }'; + +access_log syslog:server=${access_log_input} graylog2_json; +error_log syslog:server=${error_log_input}; + +*/ + with builtins; { + resource = { graylog_input = {