# Outputting Metrics while respecting Dynamic Naming Conventions

**URL:** https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179
**Category:** Logstash
**Created:** [November 2, 2017, 11:24am UTC](https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179 "2017-11-02T11:24:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ryanbarnes](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Ryanbarnes](https://discuss.elastic.co/u/Ryanbarnes)
#### Post date: [November 2, 2017, 11:24am UTC](https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179/1 "2017-11-02T11:24:48Z")

</div>

Hello,

I've been unable to reference a dynamic field name in my output.

> filter{  
> metrics {  
> meter =\> ["%{request}"]  
> add\_tag =\> "requests"  
> flush\_interval =\> "5"  
> clear\_interval =\> "60"  
> }  
> }

> output {  
> if "requests" in [tags] {  
> codec =\> line {format =\> " %{request} count: %{[%{request}][count]}"}  
> }

For each type of request, I'm expecting the %{request} field to contain the name of the particular request type (e.g HTTPRequest, SFTPRequest etc.) with the corresponding count. Instead I get the following in my terminal output:

> %{request} count: %{[%{request}][count]}

I understand that it's a referencing issue - If I change things around slightly:

> filter{  
> metrics {  
> meter =\> ["Request"]  
> add\_tag =\> "requests"  
> flush\_interval =\> "5"  
> clear\_interval =\> "60"  
> }  
> }

> output {  
> if "requests" in [tags] {  
> codec =\> line {format =\> " Request count: %{[Request][count]}"}  
> }

I can get the following in my output:

> Request count: 39

Which proves that it's an issue with referencing the dynamic field name, in this case, the specific request. It doesn't have an issue processing all of the requests at a higher level.

How can I configure my output to ensure that the dynamic field name is processed in the output? I've checked the documentation but haven't had any luck.

This topic is similar to [This Thread](https://discuss.elastic.co/t/create-metrics-with-dynamic-names/74210) but it seems that there wasn't an answer that worked.

Much appreciated!

---

<div class="post-metadata">

### Author: ![Ryanbarnes](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Ryanbarnes](https://discuss.elastic.co/u/Ryanbarnes)
#### Post date: [November 2, 2017, 12:15pm UTC](https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179/2 "2017-11-02T12:15:26Z")

</div>

@magnusbaeck any ideas on this one?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 2, 2017, 12:19pm UTC](https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179/3 "2017-11-02T12:19:01Z")

</div>

@Ryanbarnes Please do not ping people that are not already involved in the thread. This forum is manned by volunteers, so please also be patient. If you need support with defined SLAs, Elastic offers commercial [subscriptions](https://www.elastic.co/subscriptions).

---

<div class="post-metadata">

### Author: ![Ryanbarnes](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Ryanbarnes](https://discuss.elastic.co/u/Ryanbarnes)
#### Post date: [November 2, 2017, 12:36pm UTC](https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179/4 "2017-11-02T12:36:06Z")

</div>

Apologies - to clarify, there's no SLA involved, and i'm not rushing volunteers for answers, I just pinged who I thought may be able to assist to bring the issue to their attention. I've linked to a previous thread which was closed after no response regarding the same issue, so do although I appreciate that this is a community support site, I don't see any reason why we can't reach out to people directly to ask questions. If it's specified not to send private messages for help in their profile, whats the issue with creating a topic and tagging them?

If you have any input on this issue instead of suggesting subscriptions (essentially upselling), that'd be great. Otherwise, if you have something similar to above say, It would be much better to DM me directly rather than post an off topic comment in this thread.

---

<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: [November 30, 2017, 12:36pm UTC](https://discuss.elastic.co/t/outputting-metrics-while-respecting-dynamic-naming-conventions/106179/5 "2017-11-30T12:36:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
