# Add a field to @metadata dictionary

**URL:** https://discuss.elastic.co/t/add-a-field-to-metadata-dictionary/328025
**Category:** Beats
**Tags:** filebeat
**Created:** [March 19, 2023, 3:34pm UTC](https://discuss.elastic.co/t/add-a-field-to-metadata-dictionary/328025 "2023-03-19T15:34:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)
#### Post date: [March 19, 2023, 3:34pm UTC](https://discuss.elastic.co/t/add-a-field-to-metadata-dictionary/328025/1 "2023-03-19T15:34:08Z")

</div>

Wondering if would be possible to add an extra field to the @metadata 'dictionary' from an input section of filebeat?

Eg. someting like:

```auto
filebeat.input:

- type: filestream
  id: <some id goes here>
  enabled: true
  @metadata:
     dsprefix: "prefix-value_"
...

output:
  index: "%{[@metadata.dsprefix]}filebeat-%{[agent.version]}"

```

```auto
$ filebeat test config
Exiting: error loading config file: yaml: line 30: found character that cannot start any token

```

complains about the line starting with '@'

---

<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: [April 16, 2023, 5:34pm UTC](https://discuss.elastic.co/t/add-a-field-to-metadata-dictionary/328025/2 "2023-04-16T17:34:37Z")

</div>

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