# Write a Python file that is able to read a Logstash query and that execute controls on that

**URL:** <https://discuss.elastic.co/t/write-a-python-file-that-is-able-to-read-a-logstash-query-and-that-execute-controls-on-that/193583>\
**Category:** Logstash\
**Created:** [August 2, 2019, 3:31pm UTC](https://discuss.elastic.co/t/write-a-python-file-that-is-able-to-read-a-logstash-query-and-that-execute-controls-on-that/193583 "2019-08-02T15:31:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nora](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Nora](https://discuss.elastic.co/u/Nora)\
**Post date:** [August 2, 2019, 3:31pm UTC](https://discuss.elastic.co/t/write-a-python-file-that-is-able-to-read-a-logstash-query-and-that-execute-controls-on-that/193583/1 "2019-08-02T15:31:59Z")

</div>

Hi

I want to write a python program that execute controls.  
Those controls must be execute on the results of a query.

The questions are the following:

- if I've created a python file that includes both the query and the controls on they results, can I recall that whole program into Logstash and execute on that?

Or alternatively :

- If I create a logstash script containing only the query, can I recall in that script a python program that cointain just the controls?

Thanks you a lot

---

<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:** [August 30, 2019, 3:32pm UTC](https://discuss.elastic.co/t/write-a-python-file-that-is-able-to-read-a-logstash-query-and-that-execute-controls-on-that/193583/2 "2019-08-30T15:32:02Z")

</div>

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