Background: I have logstash and elasticsearch running on a server. I have a rails application which uploads a CSV to the server and logstash then processes. It works if I manually execute the generated script. If I try to have rails do a system command, I get an error.
Manually call the script from server (WORKS)
logstash_folder/execute_random.sh
Rails app system command(ERROR)
logstash_folder/execute_random.sh
Error: WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
execute_random.sh (script being called)
#!/bin/bash
sudo systemctl stop logstash
sleep 1
sudo /usr/share/logstash/bin/logstash -f logstash_folder/conf_folder/logstash.conf
Looking over this blog WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash - #15 by MrNerd
I change the script to include `--path.settings
sudo /usr/share/logstash/bin/logstash --path.settings /etc/logstash/ --path.data -f logstash_folder/#{self.logstash_index}/#{self.logstash_index}.conf"
& recieve this error
ERROR: Unknown command 'logstash_folder/conf_folder/logstash.conf
OR
[INFO ][logstash.config.source.local.configpathloader] No config files found in
path {:path=>"/logstash_folder/conf_folder/logstash.conf"}
[ERROR][logstash.config.sourceloader]
No configuration found in the configured sources.
```Preformatted text