# How to specify different index name rather than the default?

**URL:** https://discuss.elastic.co/t/how-to-specify-different-index-name-rather-than-the-default/323391
**Category:** Beats
**Tags:** filebeat
**Created:** [January 18, 2023, 8:42am UTC](https://discuss.elastic.co/t/how-to-specify-different-index-name-rather-than-the-default/323391 "2023-01-18T08:42:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![baalchina](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baalchina/32/100690_2.png) [@baalchina](https://discuss.elastic.co/u/baalchina)
#### Post date: [January 18, 2023, 8:42am UTC](https://discuss.elastic.co/t/how-to-specify-different-index-name-rather-than-the-default/323391/1 "2023-01-18T08:42:29Z")

</div>

Hello, guys,  
I already had a es cluster, and many data in it. Now I want to stor a new nginx's access/error log to my es with filebeat+nginx module. I want the index to be the a new name such as nginx-log-20230118, rather than default name(filebeat-7.16.3\*\*\*).

I tried changed the filebeat.yml file, but seems not work. Here is my config like:

```auto
setup.template.settings:
setup.template.name: "filebeat-nginx"
setup.template.pattern: "filebeat-nginx_*"
setup.template.enabled: false
setup.template.overwrite: true

```

```auto
output.elasticsearch:
  indices:
    - index: "nginx_access-%{[beat.version]}-%{+yyyy.MM.dd}"
      when.contains:
        fileset.name: "access"
    - index: "nginx_error-%{[beat.version]}-%{+yyyy.MM.dd}"
      when.contains:
        fileset.name: "error"

```

When I run filebeats -e, log shows this:

```auto
2023-01-18T16:31:59.463+0800	INFO	[index-management]	idxmgmt/std.go:261	Auto ILM enable success.
2023-01-18T16:31:59.480+0800	INFO	[index-management.ilm]	ilm/std.go:170	ILM policy filebeat exists already.
2023-01-18T16:31:59.548+0800	INFO	[index-management.ilm]	ilm/std.go:126	Index Alias filebeat-7.16.3 exists already

```

And nginx log had stored in index filebeat-7.16.3.

Where is the problem?

Thanks!

---

<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: [February 15, 2023, 10:43am UTC](https://discuss.elastic.co/t/how-to-specify-different-index-name-rather-than-the-default/323391/2 "2023-02-15T10:43:15Z")

</div>

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