# String inteprolation in logstash data\_stream fields

**URL:** https://discuss.elastic.co/t/string-inteprolation-in-logstash-data-stream-fields/317556
**Category:** Logstash
**Created:** [October 26, 2022, 8:01pm UTC](https://discuss.elastic.co/t/string-inteprolation-in-logstash-data-stream-fields/317556 "2022-10-26T20:01:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [October 26, 2022, 8:16pm UTC](https://discuss.elastic.co/t/string-inteprolation-in-logstash-data-stream-fields/317556/2 "2022-10-26T20:16:17Z")

</div>

I don't think this is supported, there was a [similar question](https://discuss.elastic.co/t/dynamic-naming-of-data-streams/283281) about it, and it seems that the data\_stream settings will not sprintf the value.

I do not use data streams, but from the elasticsearch output [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-data_stream_auto_routing) there is a setting named `data_stream_auto_routing` that may help you achieve what you want.

From what I understand, you will need to set this to `true` and create the following fields.

`data_stream.type`, `data_stream.dataset` and `data_stream.namespace`, then if those fields exist in the event, they will be used instead of the settings.

---

_[View the full topic](https://discuss.elastic.co/t/string-inteprolation-in-logstash-data-stream-fields/317556)._
