# Multiple indices for single logstash pipeline

**URL:** <https://discuss.elastic.co/t/multiple-indices-for-single-logstash-pipeline/272015>\
**Category:** Logstash\
**Created:** [May 3, 2021, 6:17pm UTC](https://discuss.elastic.co/t/multiple-indices-for-single-logstash-pipeline/272015 "2021-05-03T18:17:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srk1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srk1/32/88697_2.png) [@srk1](https://discuss.elastic.co/u/srk1)\
**Post date:** [May 3, 2021, 6:17pm UTC](https://discuss.elastic.co/t/multiple-indices-for-single-logstash-pipeline/272015/1 "2021-05-03T18:17:39Z")

</div>

Hello ES users, i have filebeat instance sending one source log to ES via logstash pipeline. Now, i want to add another file on filebeat input list and use the same logstash pipeline but write to a different new index. Can someone please share the ideal approach on how to differentiate these 2 files and at what level? Is it filter level on LS pipeline or is it at output level? Thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 4, 2021, 12:12am UTC](https://discuss.elastic.co/t/multiple-indices-for-single-logstash-pipeline/272015/2 "2021-05-04T00:12:31Z")

</div>

> [@srk1](#):
>
> i want to add another file on filebeat input list and use the same logstash pipeline but write to a different new index

Use either conditionals, or `sprintf` as mentioned in [Accessing event data and fields | Logstash Reference [8.11] | Elastic](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html)

---

<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 1, 2021, 12:12am UTC](https://discuss.elastic.co/t/multiple-indices-for-single-logstash-pipeline/272015/3 "2021-06-01T00:12:34Z")

</div>

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