# Limiting the maximum number of exec input commands

**URL:** <https://discuss.elastic.co/t/limiting-the-maximum-number-of-exec-input-commands/66415>\
**Category:** Logstash\
**Created:** [November 17, 2016, 2:55pm UTC](https://discuss.elastic.co/t/limiting-the-maximum-number-of-exec-input-commands/66415 "2016-11-17T14:55:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valentinul](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@valentinul](https://discuss.elastic.co/u/valentinul)\
**Post date:** [November 17, 2016, 2:55pm UTC](https://discuss.elastic.co/t/limiting-the-maximum-number-of-exec-input-commands/66415/1 "2016-11-17T14:55:48Z")

</div>

Hi there,

I'm using the exec input to run some perl scrips that connects to some db and retrieves some data.  
The issue is that I have like 30 exec statements and they all get executed when I start LS for the first time hitting the DB max conn limit for that user (in my case 10)

Is there a way to limit the maximum number of exec's on the next run ? Like execute max 10 exec commands, wait for them to finish...execute the next and so on.

Thanks!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 22, 2016, 8:55pm UTC](https://discuss.elastic.co/t/limiting-the-maximum-number-of-exec-input-commands/66415/2 "2016-11-22T20:55:33Z")

</div>

I don't think this is possible. Logstash can limit filtering concurrency but all inputs run in independent threads.

---

<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 20, 2016, 8:55pm UTC](https://discuss.elastic.co/t/limiting-the-maximum-number-of-exec-input-commands/66415/3 "2016-12-20T20:55:38Z")

</div>

Closed on December 20, 2016, 8:55pm UTC

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