Blob Blame History Raw
# comments are allowed in any place and start with a hash (#)
#
#cluster <name>
#    <forward | any_of | <carbon_ch | fnv1a_ch> [replication <count>]>
#        <host[:port] [proto <udp | tcp>]> ...
#    ;
#match <* | <expression>>
#    send to <cluster | blackhole>
#    [stop]
#    ;
#rewrite <expression>
#    into <replacement>
#    ;
#aggregate
#        <expression> ...
#    every <interval> seconds
#    expire after <expiration> seconds
#    compute <sum | count | max | min | average> write to
#        <metric>
#    [compute ...]
#    ;

cluster local_carbon
  forward
    127.0.0.1:2013
  ;

################################################################################
## Some example re-writes to make the graphite tree cleaner.
## This is site specific as the regex assumes the fqdn is 5 elements long.

## rewrite carbon c relay internal statistics
## from carbon.relays.twiki501.back.test.bc.local.metricsQueued
## into bc.test.twiki.twiki501.relay.metricsQueued
#rewrite ^carbon\.relays\.([a-zA-Z]+)([0-9]+)_([a-zA-Z0-9]+)_([a-zA-Z0-9]+)_([a-zA-Z0-9]+)_([a-zA-Z0-9]+)\.(.*)
#  into \5.\4.\1.\1\2.relay.\7
#  ;
## rewrite metrics to reverse hostname
## from twiki501.back.test.bc.local.haggar.agent.0.metrics.0
## into bc.test.twiki.twiki501.haggar.agent.0.metrics.0
#rewrite ^([a-zA-Z]+)([0-9]+)\.back\.([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)\.local(.*)
#  into \4.\3.\1\.\1\2\5
#  ;
## rewrite metrics from statsite
## forom sandbox.test.twiki.twiki001.statsite.gauges.gunicorn.workers
## from twiki001.back.test.sandbox.local.statsite.gauges.gunicorn.workers
## into sandbox.test.twiki.twiki001.statsite.gunicorn.gauges.workers
#rewrite ^([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)\.([a-zA-Z]+)([0-9]+)\.statsite\.([a-zA-Z]+)\.([a-zA-Z]+)\.(.*)
#  into \1.\2.\3.\4\5.statsite.\7.\6.\8
#  ;
## clean up statsite numstats metric
## from sandbox.test.twiki.twiki001.statsite.counts.numStats
## into sandbox.test.twiki.twiki001.statsite.numStats
#rewrite ^([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)\.([a-zA-Z0-9]+)\.([a-zA-Z]+)([0-9]+)\.statsite\.counts\.(.*)
#  into \1.\2.\3.\4\5.statsite.\6
#  ;
################################################################################


match *
  send to local_carbon
  stop
  ;