logstash
logstash

statsd

Status: beta

statsd is a server for aggregating counters and other metrics to ship to graphite.

The general idea is that you send statsd count or latency data and every few seconds it will emit the aggregated values to graphite (aggregates like average, max, stddev, etc)

You can learn about statsd here:

A simple example usage of this is to count HTTP hits by response code; to learn more about that, check out the log metrics tutorial

Synopsis

This is what it might look like in your config file:
output {
  statsd {
    count => ... # hash (optional), default: {}
    debug => ... # boolean (optional)
    decrement => ... # array (optional), default: []
    host => ... # string (optional), default: "localhost"
    increment => ... # array (optional), default: []
    namespace => ... # string (optional), default: "logstash"
    port => ... # number (optional), default: 8125
    sample_rate => ... # number (optional), default: 1
    sender => ... # string (optional), default: "%{@source_host}"
    tags => ... # array (optional), default: []
    timing => ... # hash (optional), default: {}
    type => ... # string (optional), default: ""
  }
}

Details

count

  • Value type is hash
  • Default value is {}

A count metric. metric_name => count as hash

debug

  • Value type is boolean
  • There is no default value for this setting.

The final metric sent to statsd will look like the following (assuming defaults) logstash.sender.file_name

Enable debugging output?

decrement

  • Value type is array
  • Default value is []

A decrement metric. metric names as array.

host

  • Value type is string
  • Default value is "localhost"

The address of the Statsd server.

increment

  • Value type is array
  • Default value is []

An increment metric. metric names as array.

namespace

  • Value type is string
  • Default value is "logstash"

The statsd namespace to use for this metric

port

  • Value type is number
  • Default value is 8125

The port to connect to on your statsd server.

sample_rate

  • Value type is number
  • Default value is 1

The sample rate for the metric

sender

  • Value type is string
  • Default value is "%{@source_host}"

The name of the sender. Dots will be replaced with underscores

tags

  • Value type is array
  • Default value is []

Only handle events with all of these tags. Note that if you specify a type, the event must also match that type. Optional.

timing

  • Value type is hash
  • Default value is {}

A timing metric. metric_name => duration as hash

type

  • Value type is string
  • Default value is ""

The type to act on. If a type is given, then this output will only act on messages with the same type. See any input plugin's "type" attribute for more. Optional.


This is documentation from lib/logstash/outputs/statsd.rb