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

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