# Hello World doesn't output to Logstash

**URL:** <https://discuss.elastic.co/t/hello-world-doesnt-output-to-logstash/226985>\
**Category:** Logstash\
**Created:** [April 7, 2020, 6:41pm UTC](https://discuss.elastic.co/t/hello-world-doesnt-output-to-logstash/226985 "2020-04-07T18:41:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eStrux-MAB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/estrux-mab/32/132834_2.png) [@eStrux-MAB](https://discuss.elastic.co/u/eStrux-MAB)\
**Post date:** [April 7, 2020, 6:41pm UTC](https://discuss.elastic.co/t/hello-world-doesnt-output-to-logstash/226985/1 "2020-04-07T18:41:32Z")

</div>

I have a Logstash conf file configured as such:

```auto
    input {
        exec {
            command => "/etc/logstash/scripts/do_something.py"
            interval => 60
        }
    }

    output {
        stdout {}
    }

```

The executed Python script is as follows:

```auto
    print('Hello world!')

```

That's it. As bog-standard and as straightforward as this. And now, here's what actually lands into the stdout console when I monitor Logstash's logging:

```auto
    Apr 7 14:05:34 myhostname logstash: {
    Apr 7 14:05:34 myhostname logstash: "host" => "myhostname.mydomain.com",
    Apr 7 14:05:34 myhostname logstash: "command" => "/etc/logstash/scripts/do_something.py",
    Apr 7 14:05:34 myhostname logstash: "@timestamp" => 2020-04-07T18:05:34.781Z,
    Apr 7 14:05:34 myhostname logstash: "message" => "",
    Apr 7 14:05:34 myhostname logstash: "@version" => "1"
    Apr 7 14:05:34 myhostname logstash: }

```

For whatever reason I don't understand, the execution completes successfully, but the words "Hello World!" aren't present at all. Yet, if I run the Python script standalone, "Hello World!" does output to the console as normal.

Meanwhile, I have several other Logstash pipelines and Python scripts that are much more elaborate and output what shows up in _stdout_ to various destinations, and they work 100%.

Obviously I must be doing something dead wrong in what turns out to be no more than the most basic of tests. I must've been banging myself against this for far too long, because I can't for the life of me figure out what's going on. I had begun with a slightly modified copy of another pipeline/script to test some error handling, and in trying to figure out the root cause of why my test wouldn't output anything, stripped it down until I was reduced to... this. A plain simple Hello World that should be foolproof, yet, go figure... isn't.

Any insight would be greatly appreciated.

---

<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:** [May 5, 2020, 6:55pm UTC](https://discuss.elastic.co/t/hello-world-doesnt-output-to-logstash/226985/2 "2020-05-05T18:55:45Z")

</div>

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