Skip to content

Instantly share code, notes, and snippets.

@robertely
Last active December 17, 2015 15:39
Show Gist options
  • Save robertely/5633493 to your computer and use it in GitHub Desktop.
Save robertely/5633493 to your computer and use it in GitHub Desktop.
Example Logstash config for consuming from collectd over amqp. Outputs to stdout.
input {
rabbitmq {
host => "rmq.xxx.xxx.com"
port => 5672
vhost => "metrics"
user => "xxxx"
password => "xxxx"
exchange => "collectd.logstash.plain"
queue => "<%= @node[:fqdn] %>"
exclusive => false
arguments => ["x-message-ttl", 300000]
threads => 24
prefetch_count => 500
ack => false
format => "plain"
type => "collectdPlain"
}
}
filter {
grok {
pattern => "machines_%{DATA:datacenter}_%{DATA:hostname}\.%{DATA:path} %{NUMBER:value} %{INT:clienttime}"
type => "collectdPlain"
}
mutate {
gsub =>[
"path", ".value", ""
,"path", "counter-", ""
,"path", "gauge-", ""
,"path", "_", "."
]
type => "collectdPlain"
}
}
output {
stdout {
debug => true debug_format => "j"
type => "collectdPlain"
}
@robertely
Copy link
Author

java -jar logstash-1.1.12-flatjar.jar agent -w 10 -f collectd-logstash-consumer-example.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment