# Is it possible to set the Statsd counter type using a variable?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-set-the-statsd-counter-type-using-a-variable/25776>\
**Category:** Logstash\
**Created:** [July 17, 2015, 8:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-set-the-statsd-counter-type-using-a-variable/25776 "2015-07-17T08:41:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![russellseymour](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russellseymour/32/1298_2.png) [@russellseymour](https://discuss.elastic.co/u/russellseymour)\
**Post date:** [July 17, 2015, 8:41am UTC](https://discuss.elastic.co/t/is-it-possible-to-set-the-statsd-counter-type-using-a-variable/25776/1 "2015-07-17T08:41:00Z")

</div>

Good morning,

I am updating my monitoring system and am thinking of changing the way metrics are sent to Graphite and want to use the Statsd output plugin.

The way that the metrics are sent to Logstash is via Redis and the object contains a metric\_type which I want to use as the setting in statsd, is this possible? An example of how I think the configuration would look would be:

```auto
output {
    statsd {
        host => 'graphite.local'
        %{metric_type} => ["%{plugin}", %{value}] 
    }
}

```

Would this work? I am assuming that it would not as the keyword is static but I wanted to check.  
If it would not work like then I would have to look at using an **IF** expression which would be OK, but this seems neater.

Thanks very much,

Russell

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:34am UTC](https://discuss.elastic.co/t/is-it-possible-to-set-the-statsd-counter-type-using-a-variable/25776/2 "2017-07-06T05:34:24Z")

</div>

Closed on July 6, 2017, 5:34am UTC


