Skip to content

Instantly share code, notes, and snippets.

@ashleyconnor
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashleyconnor/c7267f5d66a49c2755fa to your computer and use it in GitHub Desktop.
Save ashleyconnor/c7267f5d66a49c2755fa to your computer and use it in GitHub Desktop.
Example logstash config
input {
tcp { port => 3333 type => "json event" codec => json_lines {} }
stdin {
type => "stdin-type"
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
}
file {
type => "logstash"
path => [ "/var/log/logstash/logstash.log" ]
start_position => "beginning"
}
}
filter {
if [type] == "docker" {
json {
source => "message"
}
mutate {
rename => [ "log", "message" ]
}
date {
match => [ "time", "ISO8601" ]
}
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
embedded => ES_EMBEDDED
host => "ES_HOST"
port => "ES_PORT"
protocol => "http"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment