# Logstash exec input and sdtout

**URL:** https://discuss.elastic.co/t/logstash-exec-input-and-sdtout/310369
**Category:** Logstash
**Created:** [July 22, 2022, 7:30am UTC](https://discuss.elastic.co/t/logstash-exec-input-and-sdtout/310369 "2022-07-22T07:30:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Silver137](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Silver137](https://discuss.elastic.co/u/Silver137)
#### Post date: [July 22, 2022, 7:30am UTC](https://discuss.elastic.co/t/logstash-exec-input-and-sdtout/310369/1 "2022-07-22T07:30:44Z")

</div>

I'm trying to execute a custom 5 minutes duration bash script in logstash using exec input plugin.  
but imposible to get output.  
Trying things, i realized that redirecting the script stdout to stderr the script makes output, but I can't handle the stderr with filter plugins.  
Someone knows the solution?

Many thanks !

```auto
# Works
echo "Content" 1>&2

# Not Works
echo "Content" 1>

```

```auto
input {                                                                                                                                                                                                            
        exec {
                command => "bash conf.d/script.d/script.sh"
                interval => 120
                codec => line
        }   
}

filter {
        dissect { mapping => {"message" => "%{[server][domain]}"} }
        mutate { remove_field => ["event", "message", "process", "@version", "host"] }
}

output {
        stdout {codec => rubydebug}
}

```

---

<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: [August 19, 2022, 7:30am UTC](https://discuss.elastic.co/t/logstash-exec-input-and-sdtout/310369/2 "2022-08-19T07:30:50Z")

</div>

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