# Filebeat Index Issue - template pattern / name

**URL:** <https://discuss.elastic.co/t/filebeat-index-issue-template-pattern-name/133738>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 29, 2018, 6:33pm UTC](https://discuss.elastic.co/t/filebeat-index-issue-template-pattern-name/133738 "2018-05-29T18:33:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [June 1, 2018, 10:40am UTC](https://discuss.elastic.co/t/filebeat-index-issue-template-pattern-name/133738/2 "2018-06-01T10:40:45Z")

</div>

Your config seems to be incorrect. `setup.template.*` should not go under `output.elasticsearch`. It stands in the root of the config, as seen here:

```auto
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["192.168.1.199:9200"]
  index: "desktop-%{[beat.version]}-%{+yyyy.MM.dd}"
  indices:
    - index: "critical-%{[beat.version]}-%{+yyyy.MM.dd}"
      when.contains:
        message: "CRITICAL"
    - index: "error-%{[beat.version]}-%{+yyyy.MM.dd}"
      when.contains:
        message: "ERR"

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  username: "elastic"
  password: "blah"

  timeout: 180
  bulk_max_size: 2

setup.template.name: "desktop"
setup.template.pattern: "desktop-*"

```

---

_[View the full topic](https://discuss.elastic.co/t/filebeat-index-issue-template-pattern-name/133738)._
