# Filebeat Error and Configuration Issues

**URL:** https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094
**Category:** Beats
**Tags:** filebeat
**Created:** [May 23, 2023, 9:24am UTC](https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094 "2023-05-23T09:24:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Priyaansh\_Dwivedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyaansh_dwivedi/32/121317_2.png) [@Priyaansh\_Dwivedi](https://discuss.elastic.co/u/Priyaansh_Dwivedi)
#### Post date: [May 23, 2023, 9:24am UTC](https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094/1 "2023-05-23T09:24:13Z")

</div>

Despite my efforts, I have been unable to resolve the following error messages and configuration challenges. Your expertise and guidance would be greatly appreciated!  
When checking the status of Filebeat, I encountered the following error:

```auto
ExecStart=/usr/share/filebeat/bin/filebeat --environment systemd $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS (code=exited, status=>
Main PID: 76406 (code=exited, status=1/FAILURE)

```

Upon running the command `filebeat -v -e -d "*"`, I received the following error message:

```auto
"message":"Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified","service.name":"filebeat","ecs.version":"1.6.0"}
Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified

```

My Configuration YAML File:

```auto
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /var/log/jitsi/jicofo.log
  fields:
    log_type: jicofo
- type: log
  enabled: true
  paths:
    - /var/log/jitsi/jvb.log
  fields:
    log_type: jvb

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

setup.template.settings:
  index.number_of_shards: 1

setup.kibana:

output.elasticsearch:
  hosts: ["abc.def.ghij.kl:9200"]
  index: "filebeat-%{[fields.log_type]}-%{+yyyy.MM.dd}"
  setup.template.name: "filebeat"
  setup.template.pattern: "filebeat"

processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

```

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [May 24, 2023, 1:36pm UTC](https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094/2 "2023-05-24T13:36:31Z")

</div>

Hi @Priyaansh_Dwivedi,

It looks like it's not picking up the `setup.template.name` and `setup.template.pattern` properties in your YAML configuration. Should those properties not be specified as top level config (i.e. not under output.elasticsearch)?

---

<div class="post-metadata">

### Author: ![Priyaansh\_Dwivedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyaansh_dwivedi/32/121317_2.png) [@Priyaansh\_Dwivedi](https://discuss.elastic.co/u/Priyaansh_Dwivedi)
#### Post date: [May 25, 2023, 10:38am UTC](https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094/3 "2023-05-25T10:38:37Z")

</div>

Thanks for your reply. Highly appreciated.  
So where should the `setup.template.name` and `setup.template.pattern` be placed can you give more light to them?

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [May 25, 2023, 11:56am UTC](https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094/4 "2023-05-25T11:56:20Z")

</div>

So not indented under output as you have at the moment:

```yml

setup.template.name: "filebeat"
setup.template.pattern: "filebeat"
setup.template.settings:
  index.number_of_shards: 1

```

---

<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: [June 22, 2023, 1:56pm UTC](https://discuss.elastic.co/t/filebeat-error-and-configuration-issues/334094/5 "2023-06-22T13:56:56Z")

</div>

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