# Exec output plugin

**URL:** <https://discuss.elastic.co/t/exec-output-plugin/348869>\
**Category:** Logstash\
**Created:** [December 8, 2023, 8:57am UTC](https://discuss.elastic.co/t/exec-output-plugin/348869 "2023-12-08T08:57:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dor-Alter](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dor-Alter](https://discuss.elastic.co/u/Dor-Alter)\
**Post date:** [December 8, 2023, 8:57am UTC](https://discuss.elastic.co/t/exec-output-plugin/348869/1 "2023-12-08T08:57:31Z")

</div>

I am trying to create a pipeline that takes a csv file as input write it out to a different file and then run some bash script on the output file and create a new output file.

Input\_file.csv -\> logstash -\> temp\_file -\> ecex bash on temp\_file -\> logstash -\> output\_file

And the output file I will feed to elasticsearch.

Is this possible and if so how can I do that?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 8, 2023, 1:33pm UTC](https://discuss.elastic.co/t/exec-output-plugin/348869/2 "2023-12-08T13:33:46Z")

</div>

> [@Dor-Alter](#):
>
> Is this possible and if so how can I do that?

I don't think this is possible, while you have an `exec` output plugin, it will output the same data that would be in the `temp_file`.

Also, not sure why you would need Logstash for that, you can output to a temp\_file, have a bash script configured on your cron that would process that file and put in another directory where you would have another logstash pipeline reading it.

Depending on what your bash script will do, you may be able to do it directly on Logstash.

Please provide some more context of what you want to do with some sample data for your source and desired output.

---

<div class="post-metadata">

**Author:** ![Dor-Alter](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dor-Alter](https://discuss.elastic.co/u/Dor-Alter)\
**Post date:** [December 8, 2023, 1:43pm UTC](https://discuss.elastic.co/t/exec-output-plugin/348869/3 "2023-12-08T13:43:32Z")

</div>

> [@Ruby script with dynamic variables in logstash](https://discuss.elastic.co/t/ruby-script-with-dynamic-variables-in-logstash/348870):
>
> Is it possible to have a dynamic variables in ruby that changes based on the input values I am getting from the inputfile? For example I have 5 input values which the attribute linked, if the value of link is 'connected' then I will need to increase the variable otherwise nothing. And for each value I will need to assign in a new attribute the current value of the variable. if the input is: username = test1, linked = disable, ... username = test2, linked = connected, ... username = test3, li…

This provides what I want to do with example.  
I thought I can have the whole process with logstash without need to have some local exec running. As the data I am using will be modify and I want it to be up to date in elasticsearch

---

<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:** [January 5, 2024, 1:44pm UTC](https://discuss.elastic.co/t/exec-output-plugin/348869/4 "2024-01-05T13:44:14Z")

</div>

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