# Pepeline.conf

**URL:** <https://discuss.elastic.co/t/pepeline-conf/132426>\
**Category:** Logstash\
**Created:** [May 18, 2018, 6:59am UTC](https://discuss.elastic.co/t/pepeline-conf/132426 "2018-05-18T06:59:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wuwenjie\_cn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wuwenjie_cn/32/32514_2.png) [@wuwenjie\_cn](https://discuss.elastic.co/u/wuwenjie_cn)\
**Post date:** [May 18, 2018, 6:59am UTC](https://discuss.elastic.co/t/pepeline-conf/132426/1 "2018-05-18T06:59:48Z")

</div>

The following is the contents of my Logstash pipeline.conf configuration file：

```
output {
    elasticsearch {
        hosts => ["xxx.xxx.xxx.xxx:9200"]
        index => "%{[@metahostname]}" # How to write dynamic name
    }
}

```

How to configure the index section. After the log is sent from Logstash to elasticsearch, I can create an index on her own hostname in elasticsearch.

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 18, 2018, 7:06am UTC](https://discuss.elastic.co/t/pepeline-conf/132426/2 "2018-05-18T07:06:38Z")

</div>

index =\> "logstash-%{+YYYY.MM.dd}" // this will create a index a/c to date .  
OR  
Index =\>"any\_name\_you\_prefer" //this will create an index the name you provide.

---

<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:** [June 15, 2018, 7:06am UTC](https://discuss.elastic.co/t/pepeline-conf/132426/3 "2018-06-15T07:06:41Z")

</div>

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