# Help with dynamic length graphite input and measurements and fields

**URL:** <https://community.influxdata.com/t/help-with-dynamic-length-graphite-input-and-measurements-and-fields/19130>\
**Category:** InfluxDB 2\
**Tags:** influxdb, graphite\
**Created:** [March 29, 2021, 2:24pm UTC](https://community.influxdata.com/t/help-with-dynamic-length-graphite-input-and-measurements-and-fields/19130 "2021-03-29T14:24:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aap323](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@aap323](https://community.influxdata.com/u/aap323)\
**Post date:** [March 29, 2021, 2:24pm UTC](https://community.influxdata.com/t/help-with-dynamic-length-graphite-input-and-measurements-and-fields/19130/1 "2021-03-29T14:24:40Z")

</div>

Hi, I have a question regarding the graphite-API in conjunction with the graphite protocol of ingesting/querying metrics. In the templates for the InfluxDB config, was curious if anyone knew how to set the last part of the metric string to a field. Something like (example):

```
servers.hostgroup.hostname.connection.latency.endpoint.count
servers.hostgroup.hostname.connection.memory.count

```

You can see the `latency.endpoint.count` and `memory.value` with `.` as the separator are different lengths… but a template like this wouldn’t work to just take everything after `connection` as a measurement and take the last field as the field/value.

`"servers.*.*.connection.* servers.hostgroup.hostname.metricgroup.measurement*.field"`

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [March 31, 2021, 8:27pm UTC](https://community.influxdata.com/t/help-with-dynamic-length-graphite-input-and-measurements-and-fields/19130/2 "2021-03-31T20:27:09Z")

</div>

Hello @aap323,  
Welcome! I’m not sure how to navigate that.  
Perhaps you could use this to help:

> **[telegraf/plugins/processors/execd at master · influxdata/telegraf](https://github.com/influxdata/telegraf/tree/master/plugins/processors/execd)**
>
> master/plugins/processors/execd

---

<div class="post-metadata">

**Author:** ![Jess\_Ingrassellino](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jess_ingrassellino/32/5744_2.png) [@Jess\_Ingrassellino](https://community.influxdata.com/u/Jess_Ingrassellino)\
**Post date:** [April 6, 2021, 3:16pm UTC](https://community.influxdata.com/t/help-with-dynamic-length-graphite-input-and-measurements-and-fields/19130/3 "2021-04-06T15:16:19Z")

</div>

Hello @aap323

You should be able to find some help in the template pattern doc!

> <https://github.com/influxdata/telegraf/blob/master/docs/TEMPLATE_PATTERN.md>

---

<div class="post-metadata">

**Author:** ![aap323](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@aap323](https://community.influxdata.com/u/aap323)\
**Post date:** [April 6, 2021, 7:06pm UTC](https://community.influxdata.com/t/help-with-dynamic-length-graphite-input-and-measurements-and-fields/19130/4 "2021-04-06T19:06:15Z")

</div>

Thanks! It seems the functionality I was requesting isn’t quite there but I would have to explicitly define multi-length graphite metric templates as separate patterns instead of a global one. I appreciate the helpful replies!
