Executing logstash in command line worked successfully but putting the same command with the JAVA_HOME & PATH variables set & exported in a shell script doesnt work. While running the shell script, logstash comes to the point showing the below, then it hangs/goes into an idefinite loop (on seeing the --debug output);
Settings: Default pipeline workers: 16
Logstash startup completed
With the --debug and -v option in the logstash command, it repeats the below message continuously;
**Flushing buffer at interval **
Why does it hang or go into indefinite loop while executing the same in a shell script ?
Note : ConfigTest is OK in both command line and shell script.
Executing Logstash in Command Line in RHEL 5.8
$ JAVA_HOME=../java/jdk1.8.0_77/bin
$ export PATH=$JAVA_HOME:$PATH
$ ../logstash-2.2.2/bin/logstash -f _config_file < _data_file
config_file
input {
stdin { }
}
filter {
grok {
match => {
"message" => "(?<timestamp>\d{,4}-\d{,2}-\d{,2}\s\d{,2}:\d{,2}:\d{,2}),(?[\w_-]),(?[\d]+),(?[\w\d.]),(?[\w\d.]),(?[\w\d.]),(?[\d.]),(?[\w;\s])"
}
}
date {
match => [ "timestamp", "YYYY-MM-dd HH:mm:ss" ]
}
mutate {
convert => { "size" => "float" }
convert => { "count" => "integer" }
remove_field => [ "message", "@version", "_id", "_index", "_type", "host" ]
}
}
output {
stdout { codec => dots }
elasticsearch {
hosts => ""
index => ""
}
}
data_file
2010-10-10 10:10:10,name,1111,2222,3333,4444,5555,abc