# Exec output plugin crashes Logstash

**URL:** <https://discuss.elastic.co/t/exec-output-plugin-crashes-logstash/208359>\
**Category:** Logstash\
**Created:** [November 18, 2019, 5:29pm UTC](https://discuss.elastic.co/t/exec-output-plugin-crashes-logstash/208359 "2019-11-18T17:29:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Todd\_Sayers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/todd_sayers/32/45838_2.png) [@Todd\_Sayers](https://discuss.elastic.co/u/Todd_Sayers)\
**Post date:** [November 18, 2019, 5:29pm UTC](https://discuss.elastic.co/t/exec-output-plugin-crashes-logstash/208359/1 "2019-11-18T17:29:08Z")

</div>

I've been using Logstash for over two years, now. I'd now like to have Logstash execute a shell script when certain patterns are seen. To this end, I installed the logstash-output-exec plugin. However, this appears to crash Logstash. I've tried multiple versions of Logstash and multiple Java interpreters. I'm simply at a loss.

We'd like to move away from Logsurfer... but doing so requires the "exec" functionality. Anyway, Logstash seems to run for up to ~15s before respawning (ad infinitum/ab latrinae).

I created the most basic Logstash config possible... and this still fails (with the exec line uncommented):

input {  
file {  
path =\> ["/var/log/messages"]  
codec =\> plain { charset =\> "ISO-8859-1" }  
}  
}

filter {  
grok {  
match =\> { "message" =\> "%{SYSLOGTIMESTAMP:syslog\_timestamp} %{SYSLOGHOST:syslog\_hostname} %{GREEDYDATA:msg}" }  
add\_field =\> { "svc\_name" =\> "noise" }  
}  
}

output {

```
 stdout { codec => rubydebug }
 #exec { command => "/opt/foo/RabbitMQ/send-ssl.py -n %{syslog_hostname} &" }

```

}

# grep JAVA ../startup.options

#JAVACMD=/usr/bin/java  
#JAVA\_HOME=/opt/jre1.8.0\_231  
#JAVACMD=/opt/jre1.8.0\_231/bin/java  
JAVA\_HOME=/opt/jdk-11.0.5  
JAVACMD=/opt/jdk-11.0.5/bin/java

]# rpm -qa|grep -i logst  
logstash-7.4.2-1.noarch

]# java -version  
openjdk version "1.8.0\_222"

---

<div class="post-metadata">

**Author:** ![Todd\_Sayers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/todd_sayers/32/45838_2.png) [@Todd\_Sayers](https://discuss.elastic.co/u/Todd_Sayers)\
**Post date:** [November 18, 2019, 11:38pm UTC](https://discuss.elastic.co/t/exec-output-plugin-crashes-logstash/208359/2 "2019-11-18T23:38:19Z")

</div>

I burned everything the ground and reinstalled Logstash and the output plugin. It appears to work (n.b., I'm using the non-default JAVA installation listed, above).

---

<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 16, 2019, 11:38pm UTC](https://discuss.elastic.co/t/exec-output-plugin-crashes-logstash/208359/3 "2019-12-16T23:38:26Z")

</div>

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