Willem, I am a little confused - I do not understand where 'dcc' for the 'program' field is being set. Please see below:
Code: Select all
if [program] == "dcc" {Code: Select all
{GREEDYDATA:program}Code: Select all
if [program] == "dcc" {Code: Select all
{GREEDYDATA:program}Code: Select all
<155>Mar 28 13:23:21 slot1/cpf_f5_1_vir_pr err dcc[9206]: 01310033:3: [SECEV] Request blocked, violations: Attack signature detected. HTTP protocol compliance sub violations: N/A. Evasion techniques sub violations: N/A. Web services security sub violations: N/A. Virus name: N/A. Support id: 8375986001652311748, source ip: 40.70.0.8, xff ip: 40.70.0.8, source port: 49949, destination ip: 40.70.1.138, destination port: 80, route_domain: 0, HTTP classifier: /Common/F5_External_1_RAMP_Policy, scheme HTTP, geographic location: , request: www.digipolis.be\r\nUser-Agent: libwww-perl/6.04\r\n>, username: , session_id:Code: Select all
{
"loglevel": [
[
"err"
]
],
"SYSLOGPROG": [
[
"dcc[9206]"
]
],
"program": [
[
"dcc"
]
],
"pid": [
[
"9206"
]
],
"info": [
[
"01310033:3: [SECEV] Request blocked, violations: Attack signature detected. HTTP protocol compliance sub violations: N/A. Evasion techniques sub violations: N/A. Web services security sub violations: N/A. Virus name: N/A. Support id: 8375986001652311748, source ip: 40.70.0.8, xff ip: 40.70.0.8, source port: 49949, destination ip: 40.70.1.138, destination port: 80, route_domain: 0, HTTP classifier: /Common/F5_External_1_RAMP_Policy, scheme HTTP, geographic location: , request: www.digipolis.be\\r\\nUser-Agent: libwww-perl/6.04\\r\\n>, username: , session_id:"
]
]
}Code: Select all
%{GREEDYDATA:info}, source ip: %{IP:sourceip}, xff ip: %{IP:xffip}, source port: %{NUMBER:sourceport}, destination ip: %{IP:destinationip}, destination port: %{NUMBER:destinationport}, route_domain: %{NUMBER:routedomain}, HTTP classifier: %{GREEDYDATA:httpclassifier}, geographic location: , request: %{GREEDYDATA:request}, username: %{GREEDYDATA:username}, session_id: %{GREEDYDATA:sessionid}Code: Select all
username: , session_id:Code: Select all
%{GREEDYDATA:username}, session_id: %{GREEDYDATA:sessionid}Code: Select all
%{GREEDYDATA:info}, source ip: %{IP:sourceip}, xff ip: %{IP:xffip}, source port: %{NUMBER:sourceport}, destination ip: %{IP:destinationip}, destination port: %{NUMBER:destinationport}, route_domain: %{NUMBER:routedomain}, HTTP classifier: %{GREEDYDATA:httpclassifier}, geographic location: , request: %{GREEDYDATA:request}, username: %{GREEDYDATA:username}, session_id:%{GREEDYDATA:sessionid}Code: Select all
if [type] == "syslog-f5" {
grok {
break_on_match => false
match => [ "message", "\A%{SYSLOG5424PRI}%{SYSLOGTIMESTAMP} slot1\/%{HOSTNAME:logsource} %{LOGLEVEL:loglevel} %{SYSLOGPROG}: %{GREEDYDATA:info}" ]
remove_tag => "_grokparsefailure"
add_tag => "grokked_syslog_f5"
}
}
Code: Select all
if [program] == "dcc" {
grok {
match => [ "info", "%{GREEDYDATA:info}, source ip: %{IP:sourceip}, xff ip: %{IP:xffip}, source port: %{NUMBER:sourceport}, destination ip: %{IP:destinationip}, destination port: %{NUMBER:destinationport}, route_domain: %{NUMBER:routedomain}, HTTP classifier: %{GREEDYDATA:httpclassifier}, geographic location: , request: %{GREEDYDATA:request}, username: %{GREEDYDATA:username}, session_id:%{GREEDYDATA:sessionid}" ]
add_tag => "grokked_syslog_f5_dcc"
}
}tags of this log: grokked_syslog_f5,_grokparsefailure01310038:2: [SECEV] Request violations: Illegal URL,Illegal file type. HTTP protocol compliance sub violations: N/A. Evasion techniques sub violations: N/A. Web services security sub violations: N/A. Virus name: N/A. Support id: 2705742410514919698, source ip: 20.10.55.39, xff ip: 20.10.55.39, source port: 50680, destination ip: 10.40.1.139, destination port: 80, route_domain: 0, HTTP classifier: /Common/POISHPPR_class, scheme HTTP, geographic location: , request: http://shp.antw.be/sites/>, username: , session_id: <8ea44a15eea17901>
Code: Select all
"match" => { "message" => "<%{POSINT:priority}>%{SYSLOGLINE}"Code: Select all
if [type] == "syslog-f5" {
grok {
break_on_match => false
match => [ "message", "\A%{SYSLOG5424PRI}%{SYSLOGTIMESTAMP} slot1\/%{HOSTNAME:logsource} %{LOGLEVEL:severity_label} %{SYSLOGPROG}: %{GREEDYDATA:info}" ]
add_tag => "grokked_syslog_f5"
}
}
Code: Select all
if [program] == "dcc" {
grok {
patterns_dir => "/usr/local/nagioslogserver/logstash/patterns"
match => [ "info", "%{F5SEQ:f5_sequence}: %{GREEDYDATA:info}violations: %{GREEDYDATA:f5_violations}. HTTP protocol compliance sub violations: %{GREEDYDATA:f5_http_violations}. Evasion techniques sub violations: %{GREEDYDATA:f5_evasion_violations}. Web services security sub violations: %{GREEDYDATA:f5_web_svc_violations}. Virus name: %{GREEDYDATA:f5_virusname}. Support id: %{GREEDYDATA:f5_supportid}, source ip: %{IPNA:f5_sourceip}, xff ip: %{IPNA:f5_xffip}, source port: %{NUMBER:f5_sourceport}, destination ip: %{IPNA:f5_destinationip}, destination port: %{NUMBER:f5_destinationport}, route_domain: %{NUMBER:f5_routedomain}, HTTP classifier: %{GREEDYDATA:f5_http_classifier}, scheme %{SCHEME:f5_scheme}, geographic location:%{GREEDYDATA:f5_geolocation}, request: %{GREEDYDATA:f5_request}, username:%{GREEDYDATA:f5_username}, session_id: %{GREEDYDATA:f5_sessionid}" ]
match => [ "info", "%{GREEDYDATA:info}" ]
remove_tag => "grokked_syslog_f5"
add_tag => "grokked_syslog_f5_dcc"
overwrite => [ "info" ]
}
}
Code: Select all
HOSTNAMEUND \b(?:[_0-9A-Za-z][_0-9A-Za-z-]{0,62})(?:\.(?:[_0-9A-Za-z][_0-9A-Za-z-]{0,62}))*(\.?|\b)
IPNA (?:%{IPV6}|%{IPV4}|N\/A)
SCHEME (HTTPS?)
F5SEQ ([0-9]*:[0-9])Code: Select all
alter {
condrewriteother => [
"field_name", "expected_value", "field_name_to_change", "value",
"field_name2", "expected_value2, "field_name_to_change2", "value2",
....
]
}What do the different formats look like? This could be something that mutate is capable of handling: http://logstash.net/docs/1.4.2/filters/mutateFor Nagios support, it's all working relatively well now, but I'm having one small issue where the f5 logs are assigning different format of syslog levels to the severity_label field. Would I need a 'conditional alter' in order change the value of the field
err to error
info to informational
crit to critical
etc
alter {
condrewriteother => [
"field_name", "expected_value", "field_name_to_change", "value",
"field_name2", "expected_value2, "field_name_to_change2", "value2",
....
]
}
Is alter supported by NLS?
Code: Select all
/usr/local/nagioslogserver/logstash/bin/plugin install contribCode: Select all
/usr/local/nagioslogserver/logstash/bin/plugin install contribABout the mutate, I guess I'll have to use the gsub?What do the different formats look like?
Code: Select all
filter {
mutate {
gsub => [
# replace all forward slashes with underscore
"fieldname", "/", "_",
# replace backslashes, question marks, hashes, and minuses with
# dot
"fieldname2", "[\\?#-]", "."
]
}
}Code: Select all
mutate {
gsub => [
"severity_label", "err", "error",
"severity_label", "info", "informational"
]
}