# Logstash not indexing date to the filebeat write index for data stream

**URL:** <https://discuss.elastic.co/t/logstash-not-indexing-date-to-the-filebeat-write-index-for-data-stream/306360>\
**Category:** Logstash\
**Created:** [June 3, 2022, 8:00pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-date-to-the-filebeat-write-index-for-data-stream/306360 "2022-06-03T20:00:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 4, 2022, 4:17am UTC](https://discuss.elastic.co/t/logstash-not-indexing-date-to-the-filebeat-write-index-for-data-stream/306360/2 "2022-06-04T04:17:26Z")

</div>

Hi @Carlos_T Welcome to the community!

First **please** do not post images of text it is hard to read, can not be searched, can not be copied to debug, and some people can not even read them. Please post formatted Text.

That said the docs are a bit behind Issue [Here](https://github.com/elastic/logstash/issues/14008):

Try This...

The explanation is that you want logstash to write to the "write alias" which follows the format `index => "%{[@metadata][beat]}-%{[@metadata][version]}"` e.g. `filebeat-8.2.1`

```auto
input {
  beats {
    port => 5044
  }
}
output {
  if [@metadata][pipeline] {
    elasticsearch {
      hosts => "http://localhost:9200"
      pipeline => "%{[@metadata][pipeline]}"
      user => "elastic"
      password => "password"
      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}"
      action => "create"
    }
  } else {
    elasticsearch {
      hosts => "http://localhost:9200"
      user => "elastic"
      password => "password"
      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}"
      action => "create"
    }
  }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/logstash-not-indexing-date-to-the-filebeat-write-index-for-data-stream/306360)._
