# Prioritising logs Using Kafka & Logstash

**URL:** <https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057>\
**Category:** Logstash\
**Created:** [September 10, 2015, 6:15pm UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057 "2015-09-10T18:15:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deb/32/46162_2.png) [@Deb](https://discuss.elastic.co/u/Deb)\
**Post date:** [September 10, 2015, 6:15pm UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/1 "2015-09-10T18:15:12Z")

</div>

We have a deployment in which different types of logs are getting pushed to Kafka. Then logstash is pulling these logs from Kafka and pushing it to ES. We want to prioritise the way logs getting indexed in ES. For example logs of `type A` should be indexed faster than logs `type B`. Basically if there are too many logs of `type B` then they should not starve logs of `type A`.

So can some one guide me if the below deployment will achieve this.

Create two topics in Kafka let's say `topic_A` & `topic_B`. Let's say `topic_A` has 4 partitions and `topic_B` has 2 partitions. Have two kafka input in logstash one reading from `topic_A` with 4 consumer threads and the other one reading from `topic_B` with two consumer threads. or have two logstash instance running one reading from `topic_A` with 4 consumer threads and the other reading from `topic_B` with 2 consumer threads.

---

<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:** [September 11, 2015, 6:56am UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/2 "2015-09-11T06:56:43Z")

</div>

Having different topics and thread counts is probably the best way.

---

<div class="post-metadata">

**Author:** ![Deb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deb/32/46162_2.png) [@Deb](https://discuss.elastic.co/u/Deb)\
**Post date:** [September 11, 2015, 8:16am UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/3 "2015-09-11T08:16:41Z")

</div>

Thanks @warkolm.

Is multiple kafka inputs supported in a single logstash instance?

---

<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:** [September 11, 2015, 9:58am UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/4 "2015-09-11T09:58:07Z")

</div>

Yes you can.

---

<div class="post-metadata">

**Author:** ![Deb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deb/32/46162_2.png) [@Deb](https://discuss.elastic.co/u/Deb)\
**Post date:** [September 12, 2015, 4:25am UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/5 "2015-09-12T04:25:50Z")

</div>

Thanks @warkolm again.

---

<div class="post-metadata">

**Author:** ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)\
**Post date:** [September 12, 2015, 6:48pm UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/6 "2015-09-12T18:48:39Z")

</div>

Check this reply for details:

> [@Logstash-kafka for multiple topics](https://discuss.elastic.co/t/logstash-kafka-for-multiple-topics/27422):
>
> Hi! There's been some interest in the past for logstash to support multple kafka topics as inputs. At the time, the only solution was to have one topic per input. Has there been additional progress on that? Is it possible to specify multiple topics as inputs? Thanks!

---

<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:** [July 6, 2017, 5:29am UTC](https://discuss.elastic.co/t/prioritising-logs-using-kafka-logstash/29057/7 "2017-07-06T05:29:19Z")

</div>


