Skip to content

Instantly share code, notes, and snippets.

@danslimmon
Created December 22, 2011 15:11
Show Gist options
  • Save danslimmon/1510628 to your computer and use it in GitHub Desktop.
Save danslimmon/1510628 to your computer and use it in GitHub Desktop.
chef runtimes => logstash
grok patterns:
CHEF_RUNTIME INFO: Chef Run complete in %{NUMBER:runtime} seconds
HOST_PART \b[A-Za-z][0-9A-Za-z-]{0,62}\b
HOST_FIRSTPART %{HOST_PART:hostname_short}
collector.conf:
filter {
grok {
type => "chef_client_logs"
add_tag => ["chef_runtime"]
pattern => "%{CHEF_RUNTIME}"
}
grok {
type => "chef_client_logs"
match => ["@source_host", "%{HOST_FIRSTPART}"]
}
}
output {
graphite {
tags => ["chef_runtime"]
host => "graphite-collector.colo.bluestatedigital.com"
port => 2003
metrics => ["logstash.chefclient.runtime.%{hostname_short}", "%{runtime}"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment