Hi All
I am very new to Graylog, very quickly realizing how powerful the product it
I have a pfSense Firewall with SNORT installed, which works great. SNORT outputs the logs to the System Logs in pfSense and pfSense outputs the logs via SYSLOG to Greylog
All of the logs are arriving correctly within Graylog, however for the life of me I cannot parse the correct fields so I can start to get some useful data. A few examples of the MESSAGE field within the log are
snort[87537]: [136:1:1] (spp_reputation) packets blacklisted [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 2.3.4.5:16856 -> 1.2.3.4:2222
snort[87537]: [119:4:1] (http_inspect) BARE BYTE UNICODE ENCODING [Classification: Not Suspicious Traffic] [Priority: 3] {TCP} 4.5.6.7:63651 -> 1.2.3.4:8080
I am using a Pipeline with the following rule:
rule “Extract Snort alert fields”
when
has_field(“message”)
then
let m = regex("^\s?\[(\d+):(\d+):(\d+)\] (.+?) \[Classification: (.+?)\] \[Priority: (\d+)] \{(.+?)\} (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(:(\d{1,5}))? -> (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(:(\d{1,5}))?\R?", to_string($message.message));
set_field(“snort_alert”, true);
set_field(“generator_id”, m[“0”]);
set_field(“signature_id”, m[“1”]);
set_field(“signature_revision_id”, m[“2”]);
set_field(“description”, m[“3”]);
set_field(“classification”, m[“4”]);
set_field(“priority”, to_long(m[“5”]));
set_field(“protocol”, m[“6”]);
set_field(“src_addr”, m[“7”]);
set_field(“src_port”, to_long(m[“9”]));
set_field(“dst_addr”, m[“10”]);
set_field(“dst_port”, to_long(m[“12”]));
end
Any ideas on what I need to do to get this working ?
Cheers, Scott