Skip to content

Instantly share code, notes, and snippets.

@mattiaswolff
Last active September 11, 2015 16:18
Show Gist options
  • Save mattiaswolff/fe89b6e6a9536a393f0f to your computer and use it in GitHub Desktop.
Save mattiaswolff/fe89b6e6a9536a393f0f to your computer and use it in GitHub Desktop.
logstash.conf
input {
udp {
type => "backend"
port => 5000
codec => multiline {
pattern => "^\w+\s+\w+\s+[0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}:[0-9]{2}:[0-9]{2}.*$"
negate => "true"
what => "previous"
}
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
}
}
filter {
grok {
# check that fields match your IIS log settings
match => ["message", "%{WORD:deployment} %{WORD:tenant} {1,20}%{TIMESTAMP_ISO8601:log_timestamp} (?<thread>\[.*\]) %{WORD:level} {1,3}- (?<mainmessage>.*$)"]
}
#Set the Event Timesteamp from the log
date {
match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss,SSS" ]
timezone => "Etc/UCT"
}
mutate {
remove_field => [ "remove" ]
}
}
output {
elasticsearch {
embedded => true
}
}
input {
udp {
type => "backend"
port => 5000
codec => multiline {
pattern => "^\w+\s+\w+\s+[0-9]{4}-[0-9]{2}-[0-9]{2}\s[0-9]{2}:[0-9]{2}:[0-9]{2}.*$"
negate => "true"
what => "previous"
}
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
}
}
filter {
grok {
# check that fields match your IIS log settings
match => ["message", "%{WORD:deployment} %{WORD:tenant} {1,20}%{TIMESTAMP_ISO8601:log_timestamp} (?<thread>\[.*\]) %{WORD:level} {1,3}- (?<mainmessage>.*$)"]
}
#Set the Event Timesteamp from the log
date {
match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss,SSS" ]
timezone => "Etc/UCT"
}
mutate {
remove_field => [ "remove" ]
}
}
output {
elasticsearch {
embedded => true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment