# How to create a custom named time based indexing using logstash?

**URL:** <https://discuss.elastic.co/t/how-to-create-a-custom-named-time-based-indexing-using-logstash/165751>\
**Category:** Logstash\
**Created:** [January 25, 2019, 10:49am UTC](https://discuss.elastic.co/t/how-to-create-a-custom-named-time-based-indexing-using-logstash/165751 "2019-01-25T10:49:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arpit\_Khanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arpit_khanna/32/40215_2.png) [@Arpit\_Khanna](https://discuss.elastic.co/u/Arpit_Khanna)\
**Post date:** [January 25, 2019, 10:49am UTC](https://discuss.elastic.co/t/how-to-create-a-custom-named-time-based-indexing-using-logstash/165751/1 "2019-01-25T10:49:34Z")

</div>

Currently i am trying to create a time based indexing in an Elastic search using Logstash. I am trying to create a time based indexing.

I have come across and successfully tried the following output mechanism in Logstash config file

````
```
output {
  elasticsearch {
    hosts => ["127.0.0.1:9200"]

    index => "logstash-%{+xxxx.ww}"
}
file{path=>"C:/output3.txt"}
}
```

````

This is working fine But the name is required to be "logstash". I need to give it some custom name other than logstash. Can you please suggest something. Thanks again

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [January 25, 2019, 5:25pm UTC](https://discuss.elastic.co/t/how-to-create-a-custom-named-time-based-indexing-using-logstash/165751/2 "2019-01-25T17:25:59Z")

</div>

You can all it anything you want. You can even use a field value as the prefix if the events come from mixed sources and some field identifies the source (or via the translate filter, you add a field that is the source identifier)  
`index => "%{[index-source]}-%{+xxxx.ww}"`

Adjust the index expectations in Kibana as well

---

<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 22, 2019, 5:25pm UTC](https://discuss.elastic.co/t/how-to-create-a-custom-named-time-based-indexing-using-logstash/165751/3 "2019-02-22T17:25:59Z")

</div>

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