graphite

Milestone: 2

This output allows you to pull metrics from your logs and ship them to Graphite. Graphite is an open source tool for storing and graphing metrics.

An example use case: Some applications emit aggregated stats in the logs every 10 seconds. Using the grok filter and this output, it is possible to capture the metric values from the logs and emit them to Graphite.

Synopsis

This is what it might look like in your config file:
output {
  graphite {
    codec => ... # codec (optional), default: "plain"
    exclude_metrics => ... # array (optional), default: ["%{[^}]+}"]
    fields_are_metrics => ... # boolean (optional), default: false
    host => ... # string (optional), default: "localhost"
    include_metrics => ... # array (optional), default: [".*"]
    metrics => ... # hash (optional), default: {}
    metrics_format => ... # string (optional), default: "*"
    port => ... # number (optional), default: 2003
    reconnect_interval => ... # number (optional), default: 2
    resend_on_failure => ... # boolean (optional), default: false
    workers => ... # number (optional), default: 1
  }
}

Details

codec

  • Value type is codec
  • Default value is "plain"

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output, without needing a separate filter in your Logstash pipeline.

debug DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is boolean
  • Default value is false

Enable debug output.

exclude_metrics

  • Value type is array
  • Default value is ["%{[^}]+}"]

Exclude regex matched metric names, by default exclude unresolved %{field} strings.

exclude_tags DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is array
  • Default value is []

Only handle events without any of these tags. Note this check is additional to type and tags.

fields_are_metrics

  • Value type is boolean
  • Default value is false

An array indicating that these event fields should be treated as metrics and will be sent verbatim to Graphite. You may use either fields_are_metrics or metrics, but not both.

host

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

The hostname or IP address of the Graphite server.

include_metrics

  • Value type is array
  • Default value is [".*"]

Include only regex matched metric names.

metrics

  • Value type is hash
  • Default value is {}

The metric(s) to use. This supports dynamic strings like %{host} for metric names and also for values. This is a hash field with key being the metric name, value being the metric value. Example:

[ "%{host}/uptime", "%{uptime_1m}" ]

The value will be coerced to a floating point value. Values which cannot be coerced will be set to zero (0). You may use either metrics or fields_are_metrics, but not both.

metrics_format

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

Defines the format of the metric string. The placeholder ‘*’ will be replaced with the name of the actual metric.

metrics_format => "foo.bar.*.sum"

NOTE: If no metrics_format is defined, the name of the metric will be used as fallback.

port

  • Value type is number
  • Default value is 2003

The port to connect to on the Graphite server.

reconnect_interval

  • Value type is number
  • Default value is 2

Interval between reconnect attempts to Carbon.

resend_on_failure

  • Value type is boolean
  • Default value is false

Should metrics be resent on failure?

tags DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • 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.

type DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • 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.

workers

  • Value type is number
  • Default value is 1

The number of workers to use for this output. Note that this setting may not be useful for all outputs.


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