Created
April 5, 2015 11:50
-
-
Save thikade/a881163a590038330412 to your computer and use it in GitHub Desktop.
logstash: metric filter example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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