Skip to content

Instantly share code, notes, and snippets.

@deepybee
Created October 23, 2014 17:02
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 deepybee/2a5dbb6d62bdd1747284 to your computer and use it in GitHub Desktop.
Save deepybee/2a5dbb6d62bdd1747284 to your computer and use it in GitHub Desktop.
Logstash collectd config
# collectd config for logstash
input {
udp {
port => 25826
codec => 'collectd'
tags => 'collectd'
}
}
filter {
if [plugin] == 'nginx' {
mutate {
add_tag => [ 'nginx', 'webserver' ]
replace => [ 'type', 'webstats' ]
}
}
else if [plugin] == 'memcached' {
mutate {
add_tag => [ 'memcache', 'memcached', 'webserver' ]
replace => [ 'type', 'webstats' ]
}
}
else if [plugin] == 'postgresql' {
mutate {
add_tag => [ 'postgres', 'database' ]
replace => [ 'type', 'dbstats' ]
}
}
else {
mutate {
add_tag => [ 'sysstats' ]
replace => [ 'type', 'sysstats' ]
}
}
mutate {
remove_field => [ '[useragent]' ]
}
date {
match => [ 'timestamp', 'MMM dd HH:mm:ss' ]
target => '@timestamp'
}
}
output {
elasticsearch {
protocol => "http"
host => "fqdn.foo.prv"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment