Skip to content

Instantly share code, notes, and snippets.

@fefore
Last active October 31, 2017 00:35
Show Gist options
  • Save fefore/c21753dc26ea0182ea8d590fc83e1e65 to your computer and use it in GitHub Desktop.
Save fefore/c21753dc26ea0182ea8d590fc83e1e65 to your computer and use it in GitHub Desktop.
[LOGSTASH] Grok Pattern for log4net logs
filter {
if [type] == "log4net" {
grok {
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} \[%{NUMBER:threadid}\] %{WORD:level}\s*%{DATA:class} \[%{DATA:NDC}\]\s+-\s+%{GREEDYDATA:message}" ]
}
mutate {
update => {
"type" => "log4net-log"
}
remove_field => [
"[beat][hostname]",
"[beat][name]",
"[beat][version]"
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment