# Filebeat not creating new index in Elastic search?

**URL:** <https://discuss.elastic.co/t/filebeat-not-creating-new-index-in-elastic-search/228644>\
**Category:** Beats\
**Created:** [April 18, 2020, 12:54pm UTC](https://discuss.elastic.co/t/filebeat-not-creating-new-index-in-elastic-search/228644 "2020-04-18T12:54:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pracks1982](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pracks1982](https://discuss.elastic.co/u/pracks1982)\
**Post date:** [April 18, 2020, 12:54pm UTC](https://discuss.elastic.co/t/filebeat-not-creating-new-index-in-elastic-search/228644/1 "2020-04-18T12:54:36Z")

</div>

I have a microservice users-ws for which i want to see logs getting pulled by filebeat and send to elasticsearch and logstash for searching and filtering. I have a problem that with  
the configuration below its not creating new indexes ..  
filebeat.yml -

```
filebeat.inputs:
  - type: log
     enabled: true
     paths:
       - C:\my_projects\PhotoAppAPIUsers\users-ws.log

   fields:
     log_type: users-ws-log

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

setup.template.settings:
index.number_of_shards: 1

output.elasticsearch:
hosts: ["localhost:9200"]

output.logstash:
hosts: ["localhost:5044"]

logstash conf :

    input {
       beats {
         port => 5044
   }
   }

  filter {
  if [log_type] == "users-ws-log" {
    mutate { add_field => { "[@metadata][target_index]" => "users-ws-log-%{+YYYY.MM}" 
     } }
      } else if [log_type] == "albums-ws-log" {
       mutate { add_field => { "[@metadata][target_index]" => "albums-ws-log-% 
       {+YYYY.MM.dd}" } }
        } else {
         mutate { add_field => { "[@metadata][target_index]" => "unknown-%{+YYYY}" } }
    }
}

output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "%{[@metadata][target_index]}"
  }
  stdout { codec => rubydebug}
}

```

Please let me know if i am missing any thing . Everytime i start my microservice though its generating new logs but i don't see new indexes getting created using filebeat.

Below are the indexes everytime created :  
green open ilm-history-1-000001 g8nmTY7UQCiH7VDlSyQyQw 1 0 18 0 25.4kb 25.4kb  
yellow open filebeat-7.6.2-2020.04.17-000001 WMENcfDbRsGKNLjwMYIIzw 1 1 7432 0 1.5mb 1.5mb

Also its not creating the indexes the way i have configured in logstash.

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 20, 2020, 2:56pm UTC](https://discuss.elastic.co/t/filebeat-not-creating-new-index-in-elastic-search/228644/2 "2020-04-20T14:56:24Z")

</div>

Hi @pracks1982, welcome to the Elastic community forums!

Looking at your `filebeat.yml`, I see two `output`s enabled — `elasticsearch` and `logstash`. This is not supported by Beats; only one output can be enabled at any given time. Are you sure your Filebeat is running without any errors? Could you check the Filebeat log after restarting it?

Shaunak

---

<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:** [May 18, 2020, 5:06pm UTC](https://discuss.elastic.co/t/filebeat-not-creating-new-index-in-elastic-search/228644/3 "2020-05-18T17:06:04Z")

</div>

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