# New index is not created

**URL:** https://discuss.elastic.co/t/new-index-is-not-created/215091
**Category:** Elasticsearch
**Created:** [January 15, 2020, 8:20am UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091 "2020-01-15T08:20:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Wojciech\_Gomola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wojciech_gomola/32/60599_2.png) [@Wojciech\_Gomola](https://discuss.elastic.co/u/Wojciech_Gomola)
#### Post date: [January 15, 2020, 8:20am UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/1 "2020-01-15T08:20:14Z")

</div>

Hi. I have Filebeat + ELK stack. My Logstash has a pretty standard configuration:

```
input {
  beats {
    port => 5044
  }
}

filter {
  grok {
  	match => {
  		"message" => "^(?<log_date>\d{4}-\d\d-\d\d \d\d:\d\d:\d\d.\d\d\d)\d?\|(?<level>WARN|INFO|DEBUG|ERROR|FATAL)\|%{GREEDYDATA:message}"
  	}
  }
  date {
    match => ["log_date", "yyyy-MM-dd HH:mm:ss.SSS"]
    timezone => "+01:00"
    remove_field => ["log_date"]
  }
}

output {
  elasticsearch {
    hosts => ["elastic:9201", "elastic:9202"]
  }
}

```

Yes, I have 2 instances of ES on a single machine, but they use different directories. For some reason indices are not created daily I have 2 indices. Both created the 28th of December. New docs are added to the second one.  
Does someone know what I did wrong?

---

<div class="post-metadata">

### Author: ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)
#### Post date: [January 15, 2020, 10:12am UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/2 "2020-01-15T10:12:13Z")

</div>

Hi

You can specify indices like this in your output

```auto
output {
  elasticsearch {
    hosts => ["elastic:9201", "elastic:9202"]
    index = > "foobar"
  }
}

```

You should reffer to : [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/logstash-output.html)

if you want something daily you should try something like this

```auto
index = > "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"

```

---

<div class="post-metadata">

### Author: ![Wojciech\_Gomola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wojciech_gomola/32/60599_2.png) [@Wojciech\_Gomola](https://discuss.elastic.co/u/Wojciech_Gomola)
#### Post date: [January 15, 2020, 12:29pm UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/3 "2020-01-15T12:29:06Z")

</div>

I don't wanna specify it manually. AFAIK default one should work as I expect. I suppose that it is related to ILM, for some reason, Logstash is not able to figure out the format.

---

<div class="post-metadata">

### Author: ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)
#### Post date: [January 15, 2020, 12:33pm UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/4 "2020-01-15T12:33:59Z")

</div>

Maybe, you should try logstash log level debug and see what's happening.

---

<div class="post-metadata">

### Author: ![Wojciech\_Gomola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wojciech_gomola/32/60599_2.png) [@Wojciech\_Gomola](https://discuss.elastic.co/u/Wojciech_Gomola)
#### Post date: [January 16, 2020, 2:11pm UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/5 "2020-01-16T14:11:20Z")

</div>

Nothing realy interesting. It uses default index. To be sure I dropped index template and LS recreated it. It still writes to old index.

```
[2020-01-16T14:16:46,488][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@index = "logstash-%{+YYYY.MM.dd}"
[2020-01-16T14:16:46,488][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@manage_template = true
[2020-01-16T14:16:46,489][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@template_name = "logstash"
[2020-01-16T14:16:46,489][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@template_overwrite = false

```

I have also added the second file output plugin and I see that timestamp is properly formatted. What date does the ES plugin use for index names?

Edit:  
Logs related to ILM:

```
[2020-01-16T14:16:46,497][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@ilm_enabled = "auto"
[2020-01-16T14:16:46,497][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@ilm_rollover_alias = "logstash"
[2020-01-16T14:16:46,498][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@ilm_pattern = "{now/d}-000001"
[2020-01-16T14:16:46,498][DEBUG][logstash.outputs.elasticsearch] config LogStash::Outputs::ElasticSearch/@ilm_policy = "logstash-policy"
```

---

<div class="post-metadata">

### Author: ![Wojciech\_Gomola](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wojciech_gomola/32/60599_2.png) [@Wojciech\_Gomola](https://discuss.elastic.co/u/Wojciech_Gomola)
#### Post date: [January 16, 2020, 3:39pm UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/6 "2020-01-16T15:39:18Z")

</div>

I used custom index format and used lowercase y instead of uppercase and it fixed issue. Other peoples struggles with it also [Github](https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/876)

---

<div class="post-metadata">

### Author: ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)
#### Post date: [January 17, 2020, 8:56am UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/7 "2020-01-17T08:56:19Z")

</div>

Oh i forgot that, ineed no caps in index names

---

<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 14, 2020, 8:56am UTC](https://discuss.elastic.co/t/new-index-is-not-created/215091/8 "2020-02-14T08:56:26Z")

</div>

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