# Exec plugin

**URL:** <https://discuss.elastic.co/t/exec-plugin/81717>\
**Category:** Logstash\
**Created:** [April 9, 2017, 3:23pm UTC](https://discuss.elastic.co/t/exec-plugin/81717 "2017-04-09T15:23:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbl](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@jbl](https://discuss.elastic.co/u/jbl)\
**Post date:** [April 9, 2017, 3:23pm UTC](https://discuss.elastic.co/t/exec-plugin/81717/1 "2017-04-09T15:23:05Z")

</div>

Hello,

\*\*\* goal is to process logstash data in realtime \*\*\*

I am new to logstash, and i tried the exec plugin in order to process the output with php script :

output {  
exec {  
command =\> "php /opt/admin/script.php %{message}"  
}  
}

in the example above, one instance of php script is called everytime for each output.

what i would lilke to do is to have a script that can track all ouputs, so that way of doing is wrong.

What would be the best approach ? Send output to elasticsearch and use RestAPI with a php script to follow the flow of output ? What the "real time" would be, i mean how to be closest to the "realtime" ?.

Regards

---

<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:** [April 10, 2017, 5:31am UTC](https://discuss.elastic.co/t/exec-plugin/81717/2 "2017-04-10T05:31:22Z")

</div>

Have a look at the pipe output.

I'd send the events to a broker (Redis, RabbitMQ, Kafka, ...) and write a script that pulls the events from there.

---

<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:** [May 8, 2017, 5:34am UTC](https://discuss.elastic.co/t/exec-plugin/81717/3 "2017-05-08T05:34:53Z")

</div>

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