# Logstash --configtest & stdout

**URL:** <https://discuss.elastic.co/t/logstash-configtest-stdout/56548>\
**Category:** Logstash\
**Created:** [July 27, 2016, 5:17pm UTC](https://discuss.elastic.co/t/logstash-configtest-stdout/56548 "2016-07-27T17:17:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)\
**Post date:** [July 27, 2016, 5:17pm UTC](https://discuss.elastic.co/t/logstash-configtest-stdout/56548/1 "2016-07-27T17:17:45Z")

</div>

Hi,  
I have an annoying little problem on a logstash 2.3.4 installed (from the repo) on a Linux Mint development box  
May be this problem is more linux oriented.  
I would like to catch the result of a configtest command

In a shell, the command " /opt/logstash/bin/logstash --configtest" shows the line "Configuration OK"  
But this output doesn't seem to be bound to the process standard output.

/opt/logstash/bin/logstash --configtest \> test  
==\> test is an empty file

In contrast, a --version command is OK for me  
/opt/logstash/bin/logstash --configtest \> test  
==\> test contains "logstash 2.3.4"

I'm looking for a workaround...

Franck

---

<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:** [July 27, 2016, 5:24pm UTC](https://discuss.elastic.co/t/logstash-configtest-stdout/56548/2 "2016-07-27T17:24:31Z")

</div>

Presumably the output is sent to stderr and not to stdout.

---

<div class="post-metadata">

**Author:** ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)\
**Post date:** [July 27, 2016, 5:30pm UTC](https://discuss.elastic.co/t/logstash-configtest-stdout/56548/3 "2016-07-27T17:30:16Z")

</div>

I did checked this too (/opt/logstash/bin/logstash --configtest 1\> test 2\> test)

Also tried to redirect to log (/opt/logstash/bin/logstash --configtest --log test)

.. Actually diving in Ruby code That I don't know at all..

---

<div class="post-metadata">

**Author:** ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)\
**Post date:** [July 27, 2016, 5:49pm UTC](https://discuss.elastic.co/t/logstash-configtest-stdout/56548/4 "2016-07-27T17:49:24Z")

</div>

As a workaround, I changed one line in agent.rb

begin  
# currently the best strategy to validate the configuration  
# is creating a pipeline instance and checking for exceptions  
LogStash::Pipeline.new(config\_str)  
**#@logger.terminal "Configuration OK"**  
**puts "Configuration OK"**  
return 0

---

<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:** [July 6, 2017, 4:46am UTC](https://discuss.elastic.co/t/logstash-configtest-stdout/56548/5 "2017-07-06T04:46:14Z")

</div>


