Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@maguec
Created February 2, 2015 23:56
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 maguec/225c4d3107fa505edcb8 to your computer and use it in GitHub Desktop.
Save maguec/225c4d3107fa505edcb8 to your computer and use it in GitHub Desktop.
input {
file {
path => "/home/chris/Code/LS_TEST/logstash-1.4.2/b.log"
type => "json_haproxy"
sincedb_path => "/tmp/since"
codec => "json"
}
}
output {
if [DTM_STATS] =~ /[A-Za-z0-9]/ {
if [stat_type] == 'timer' {
statsd {
host => "10.0.3.155"
sender => "%{app_name}"
port => 8125
namespace => "dtm"
timing => [ "%{env}.%{DTM_STATS}", "%{stat_value}" ]
}
}
if [stat_type] == 'gauge' {
statsd {
host => "10.0.3.155"
sender => "%{app_name}"
namespace => "dtm"
port => 8125
gauge => [ "%{env}.%{DTM_STATS}", "%{stat_value}" ]
}
}
if [stat_type] == 'counter' {
statsd {
host => "10.0.3.155"
sender => "%{app_name}"
namespace => "dtm"
port => 8125
increment => [ "%{env}.%{DTM_STATS}", 1 ]
}
}
if [DTM_EVENT] =~ /[A-Za-z0-9]/ {
statsd {
host => "10.0.3.155"
sender => "%{app_name}"
namespace => "dtm"
port => 8125
increment => [ "%{env}.%{DTM_EVENT}", 1 ]
}
}
}
}
output {
stdout { codec => rubydebug }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment