Skip to content

Instantly share code, notes, and snippets.

@thikade
Created April 5, 2015 11:50
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 thikade/a881163a590038330412 to your computer and use it in GitHub Desktop.
Save thikade/a881163a590038330412 to your computer and use it in GitHub Desktop.
logstash: metric filter example
input {
##
## how to feed into this input: "cat /tmp/logstash.input | pv -l -L 10000 | nc localhost 33333"
##
tcp { type => "tcp" port => 33333 }
}
filter {
metrics {
meter => [ "events" ]
add_tag => "metric"
# clear_interval => 60
}
}
output {
# stdout { codec => rubydebug }
if "metric" in [tags] {
stdout {
codec => line { format => "count: %{events.count} Rate: %{events.rate_1m}" }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment