# Beats to create daily index

**URL:** <https://discuss.elastic.co/t/beats-to-create-daily-index/247096>\
**Category:** Beats\
**Tags:** auditbeat\
**Created:** [September 1, 2020, 1:03pm UTC](https://discuss.elastic.co/t/beats-to-create-daily-index/247096 "2020-09-01T13:03:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![headtea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/headtea/32/24271_2.png) [@headtea](https://discuss.elastic.co/u/headtea)\
**Post date:** [September 1, 2020, 1:03pm UTC](https://discuss.elastic.co/t/beats-to-create-daily-index/247096/1 "2020-09-01T13:03:41Z")

</div>

Auditbeat is configured to send data to Elasticsearch directly. I'm trying to get auditbeat to create a new index every day. Right now this is the index that beats uses: `auditbeat-7.9.0-2020.08.24-000001`, even though today is `2020.09.01`.

For that, I've set up these lines in `auditbeat.yml`:

```
output.elasticsearch:
  index: "auditbeat-%{[agent.version]}-%{+yyyy.MM.dd}"
  setup.template.name: "auditbeat"
  setup.template.pattern: "auditbeat-*"

```

But when I start auditbeat I get this:

```
Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified

```

Does anyone know why I get this? As seen in my `.yml` file I have included these fields.

Thanks ahead!

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [September 1, 2020, 11:41pm UTC](https://discuss.elastic.co/t/beats-to-create-daily-index/247096/2 "2020-09-01T23:41:21Z")

</div>

I think [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index\_.html#index-creation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation) is what you are looking for. You can `add auditbeat-*` into the list for `action.auto_create_index` setting.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 2, 2020, 12:31am UTC](https://discuss.elastic.co/t/beats-to-create-daily-index/247096/3 "2020-09-02T00:31:43Z")

</div>

I think this topic relates to your other ones on ILM, as Auditbeat is using ILM here.

---

<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:** [September 30, 2020, 2:32am UTC](https://discuss.elastic.co/t/beats-to-create-daily-index/247096/4 "2020-09-30T02:32:03Z")

</div>

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