2019-10-24 02:20:38 +02:00
|
|
|
# filters nginx messages
|
2019-12-20 05:54:26 +01:00
|
|
|
{ config, ... }: {
|
2019-10-24 02:20:38 +02:00
|
|
|
resource."graylog_pipeline_rule" = {
|
|
|
|
|
|
|
|
# not working for some reason
|
|
|
|
extractHttpCode = {
|
|
|
|
description = "extract thread information nginx access (TF)";
|
|
|
|
source = ''
|
|
|
|
rule "extract response code"
|
|
|
|
when
|
|
|
|
has_field("response_status")
|
|
|
|
then
|
|
|
|
set_field("response_status_description", lookup_value("http_codes_description", to_long($message.response_status)));
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
graylog.pipeline.processNginxMessage = {
|
|
|
|
source = ''
|
|
|
|
stage 99 match all
|
|
|
|
rule "extract response code";
|
|
|
|
'';
|
|
|
|
#streamId = config.graylog.all_messages.streamId;
|
|
|
|
#streamId = "\${data.graylog_stream.nginx.id}";
|
|
|
|
};
|
|
|
|
|
|
|
|
resource.graylog_pipeline_connection.processNginxMessage = {
|
|
|
|
stream_id = "\${data.graylog_stream.nginx.id}";
|
2019-12-20 05:54:26 +01:00
|
|
|
pipeline_ids = [ "\${graylog_pipeline.processNginxMessage.id}" ];
|
2019-10-24 02:20:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
data.graylog_stream.nginx.title = "nginx";
|
|
|
|
|
|
|
|
}
|