# Filebeat does not set the index for logstash output even after providing index name in filebeat

**URL:** https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537
**Category:** Beats
**Created:** [December 9, 2016, 9:09am UTC](https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537 "2016-12-09T09:09:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Rupesh\_Ranjan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rupesh_ranjan/32/22283_2.png) [@Rupesh\_Ranjan](https://discuss.elastic.co/u/Rupesh_Ranjan)
#### Post date: [December 9, 2016, 9:09am UTC](https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537/1 "2016-12-09T09:09:04Z")

</div>

In my filebeat.full.yml file, i have set the following configuration

output.logstash:  
enabled: true  
hosts: ["localhost:5043"]  
index: "testing-%{+yyyy.MM.dd}"

Even after this, the index name appears as "logstash-%{+yyyy.MM.dd}".  
I do not want to set the index name in logstash config file separately.  
Any suggestions, how can i set the index name as "testing-%{+yyyy.MM.dd}"?

P.S. I am using version 5.0.1 fro both filebeat and logstash.

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [December 9, 2016, 1:00pm UTC](https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537/2 "2016-12-09T13:00:38Z")

</div>

the index name must be set in logstash. The default pattern we provide in getting started docs for logstash also uses logstash to set the index name based on timestamp.

---

<div class="post-metadata">

### Author: ![Rupesh\_Ranjan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rupesh_ranjan/32/22283_2.png) [@Rupesh\_Ranjan](https://discuss.elastic.co/u/Rupesh_Ranjan)
#### Post date: [December 14, 2016, 12:44pm UTC](https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537/3 "2016-12-14T12:44:12Z")

</div>

Thank you,  
Can you tell me then, what the index in the question that i have posted, used for?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [December 14, 2016, 3:13pm UTC](https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537/4 "2016-12-14T15:13:39Z")

</div>

The `index` field configured in logtash output in beats will be available in logstash via `[@metadata][beat]`. By default the value is `filebeat`.

Here is an [example](https://www.elastic.co/guide/en/beats/libbeat/5.1/logstash-installation.html#logstash-setup) using `[@metadata][beat]` to configure the index pattern in logstash elasticsearch output.

---

<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: [December 30, 2016, 9:09am UTC](https://discuss.elastic.co/t/filebeat-does-not-set-the-index-for-logstash-output-even-after-providing-index-name-in-filebeat/68537/5 "2016-12-30T09:09:18Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
