# Creating index name from field value

**URL:** https://discuss.elastic.co/t/creating-index-name-from-field-value/283677
**Category:** Beats
**Tags:** filebeat
**Created:** [September 8, 2021, 2:43pm UTC](https://discuss.elastic.co/t/creating-index-name-from-field-value/283677 "2021-09-08T14:43:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Paintras](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paintras/32/93819_2.png) [@Paintras](https://discuss.elastic.co/u/Paintras)
#### Post date: [September 8, 2021, 2:43pm UTC](https://discuss.elastic.co/t/creating-index-name-from-field-value/283677/1 "2021-09-08T14:43:47Z")

</div>

Good day,  
this is my filebeat.yml file:

```auto
filebeat.config:
    modules:
        path: ${path.config}/modules.d/*.yml
        reload.enabled: false

processors:
    - add_cloud_metadata: ~
    - add_docker_metadata: ~
    - add_kubernetes_metadata: ~

output.elasticsearch:
    hosts: '${ELASTICSEARCH_HOSTS:elasticsearch:9200}'
    username: '${ELASTICSEARCH_USERNAME:}'
    password: '${ELASTICSEARCH_PASSWORD:}'

setup.kibana:
    host: '${KIBANA_HOST}'
    ssl.enabled: false

filebeat.modules:
    - module: kibana
    - module: elasticsearch

fields_under_root: true
json.keys_under_root: true

filebeat.inputs:
    - type: log
      enabled: true
      fields:
          my_type: 'inventory'
      index: 'test-%{[fields.my_type]}-%{+yyyy.MM.dd}'
      paths:
          - /var/log/kibana/kibana.log

setup.ilm.overwrite: true
setup.ilm.enabled: false
setup.template.name: 'test-%{[fields.my_type]}-%{+yyyy.MM.dd}'
setup.template.pattern: 'test-%{[fields.my_type]}-*'

```

I want create index where my fields are present ( specifically log file name )  
It works when I try to do it with agent fields like` {[agent.version]}`, but got error when I am trying to make name from my custom field or other ones like `{[file.name]}`  
This is the error from filebeat log:  
`ERROR [publisher] pipeline/client.go:106 Failed to publish event: key not found`  
Thanks for any hints

---

<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: [October 6, 2021, 4:44pm UTC](https://discuss.elastic.co/t/creating-index-name-from-field-value/283677/2 "2021-10-06T16:44:34Z")

</div>

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