Hi, i'm trying to use logstash exec input plugin to run a shell script, however i'm not getting any result.
i have a sample shell script
/scripts/myscript.sh
the contents is just
ls
if i start logstash with the following configuration:
input {
exec {
command => "/script/myscript.sh"
interval => 60
type => "test"
}
}
output {
stdout { codec => rubydebug }
elasticsearch { hosts => ["localhost:9200"]
index => "myindex-%{[type]}-%{+YYYY.MM.dd}"
}
}
then the message is empty, however if i start with:
input {
exec {
command => "ls"
interval => 60
type => "test"
}
}
output {
stdout { codec => rubydebug }
elasticsearch { hosts => ["localhost:9200"]
index => "myindex-%{[type]}-%{+YYYY.MM.dd}"
}
}
then message has the output of ls.
Why are shell scripts not running or not returning what they should?
This is just a simple test, in my case i need to put more logic on the shell script, if it would be simple would just use the second option.
Any idea?