diff --git a/terranix/graylog/config.nix b/terranix/graylog/config.nix index c6141cd..cb9746f 100644 --- a/terranix/graylog/config.nix +++ b/terranix/graylog/config.nix @@ -1,10 +1,6 @@ with builtins; { - imports = [ - ./provider.nix - #./nginx.nix - ./journald.nix - ]; + imports = [ ./provider.nix ./nginx.nix ./journald.nix ]; resource.graylog_output.stdout = { title = "test stdout"; diff --git a/terranix/graylog/journald.nix b/terranix/graylog/journald.nix index 17670a2..62edd23 100644 --- a/terranix/graylog/journald.nix +++ b/terranix/graylog/journald.nix @@ -1,7 +1,5 @@ with builtins; { - #data.graylog_index_set.default.index_prefix = "graylog"; - resource = { graylog_input.journald = { @@ -18,11 +16,9 @@ with builtins; { }); }; - # todo create stream graylog_stream.journald = { title = "journald"; description = "journald processing stream"; - #index_set_id = "\${data.graylog_index_set.default.id}"; index_set_id = "\${graylog_index_set.default.id}"; disabled = false; matching_type = "AND"; diff --git a/terranix/graylog/nginx.nix b/terranix/graylog/nginx.nix index c956672..7b180c9 100644 --- a/terranix/graylog/nginx.nix +++ b/terranix/graylog/nginx.nix @@ -1,55 +1,66 @@ with builtins; { - resource.graylog_input = { - nginx_access_logs = { - title = "test nginx access log input"; - # https://javadoc.io/doc/org.graylog2/graylog2-inputs/latest/index.html - type = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"; - global = true; - attributes = toJSON ({ - allow_override_date = true; - bind_address = "0.0.0.0"; - expand_structured_data = false; - force_rdns = false; - number_worker_threads = 2; - port = 12209; # todo - recv_buffer_size = 262144; - store_full_message = false; - }); - }; - nginx_error_logs = { - title = "test nginx error log input"; - # https://javadoc.io/doc/org.graylog2/graylog2-inputs/latest/index.html - type = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"; - global = true; - attributes = toJSON ({ - allow_override_date = true; - bind_address = "0.0.0.0"; - expand_structured_data = false; - force_rdns = false; - number_worker_threads = 2; - port = 12208; # todo - recv_buffer_size = 262144; - store_full_message = false; - }); - }; - }; - resource.graylog_input_static_fields = { - nginx_access_logs = { - input_id = "\${graylog_input.nginx_access_logs.id}"; - fields = { - from_nginx = true; - nginx_error = false; - nginx_access = true; + resource = { + + graylog_input = { + + nginx_access_logs = { + title = "nginx access log"; + # https://javadoc.io/doc/org.graylog2/graylog2-inputs/latest/index.html + type = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"; + global = true; + attributes = toJSON ({ + allow_override_date = true; + bind_address = "0.0.0.0"; + expand_structured_data = false; + force_rdns = false; + number_worker_threads = 4; + port = 12304; + recv_buffer_size = 1048576; + store_full_message = false; + }); }; - }; - nginx_error_logs = { - input_id = "\${graylog_input.nginx_error_logs.id}"; - fields = { - from_nginx = true; - nginx_error = true; - nginx_access = false; + + nginx_error_logs = { + title = "nginx error log"; + # https://javadoc.io/doc/org.graylog2/graylog2-inputs/latest/index.html + type = "org.graylog2.inputs.syslog.udp.SyslogUDPInput"; + global = true; + attributes = toJSON ({ + allow_override_date = true; + bind_address = "0.0.0.0"; + expand_structured_data = false; + force_rdns = false; + number_worker_threads = 4; + port = 12305; + recv_buffer_size = 1048576; + store_full_message = false; + }); }; + }; + + graylog_input_static_fields = { + + nginx_access_logs = { + input_id = "\${graylog_input.nginx_access_logs.id}"; + fields = { + from_nginx = true; + nginx_error = false; + nginx_access = true; + }; + }; + + nginx_error_logs = { + input_id = "\${graylog_input.nginx_error_logs.id}"; + fields = { + from_nginx = true; + nginx_error = true; + nginx_access = false; + }; + }; + + }; + }; } diff --git a/terranix/graylog/terraform.tfstate b/terranix/graylog/terraform.tfstate index 51b6ee4..91f7397 100644 Binary files a/terranix/graylog/terraform.tfstate and b/terranix/graylog/terraform.tfstate differ