# Elasticsearch Setup Custom Index and Write Issue

**URL:** <https://discuss.elastic.co/t/elasticsearch-setup-custom-index-and-write-issue/327332>\
**Category:** Kibana\
**Created:** [March 9, 2023, 8:28am UTC](https://discuss.elastic.co/t/elasticsearch-setup-custom-index-and-write-issue/327332 "2023-03-09T08:28:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk-siwm](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@elk-siwm](https://discuss.elastic.co/u/elk-siwm)\
**Post date:** [March 9, 2023, 8:28am UTC](https://discuss.elastic.co/t/elasticsearch-setup-custom-index-and-write-issue/327332/1 "2023-03-09T08:28:45Z")

</div>

Elasticsearch get logs via filebeats shipper default settings. All custom index settings were configured on `/etc/filebeats/filebeats.yml` file. This is my configuration file:

```yml
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["host-ip:9200"]
  protocol: "https"
  index: "samba-%{[agent.hostname]}-%{[agent.version]}-%{+dd.MM.yyyy}"
  # Authentication credentials - either API key or username/password.
  username: "elastic"
  password: "password"
  ssl:
    enabled: true
    certificate_authorities:
      - |
        -----BEGIN CERTIFICATE-----
       XXX
        -----END CERTIFICATE-----

setup.template:
  name: "samba"
  pattern: "samba-%{[agent.version]}"
  overwrite: true

setup.ilm.enabled: false

```

When the filebeat setup command was run, `"no matching index template found for data stream [samba]"` exception was thrown, **although this custom index template was created on ELK**. After start the filebeat service, all logs were collected on default index (.ds-filebeat-8.6.2-2023.03.09-000001). How can i fix this?

---

<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 6, 2023, 8:29am UTC](https://discuss.elastic.co/t/elasticsearch-setup-custom-index-and-write-issue/327332/2 "2023-04-06T08:29:05Z")

</div>

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