Logstash command not found error


(Alpha Gamma) #1

I have ubuntu 16.04 system, I ahve logstash installed in /etc/logstash the command

sudo service logstash start

works well but the command

/bin/logstash -f logstash.conf does work

I have one more location /usr/share/logstash/bin but I am not able to run above command,please guide asap


(Krunal Kalaria) #2

Hi @alpha_gamma,

you try this path to run your configuration file: /usr/share/logstash/bin
(save config file in this path and run following command)

in that bin you type following command:
.\logstash -f .\logstash.conf

i think its work.

Thanks & Regards,
Krunal.


(Alpha Gamma) #3

Hi Krunal thanks for reply still it says command not found

If I do sudo service logstash start it works but that I dont seem relevant to parse config file


(Krunal Kalaria) #4

can you show me your config file and which ELK stack version are you currently running?


(Alpha Gamma) #5

like I am putting config file in /etc/logstash/conf.d

logstash.conf

input {
file {
path => "/var/log/*"
start_position => "beginning"
}
}

output {
elasticsearch {
hosts => ["localhost:9200"]
index => "syslog-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}

I think I am using lostash 6.1 version


(Krunal Kalaria) #6

if at a time you have to run one conf file then you save your conf file in /usr/share/logstash/bin and then type command sudo .\logstash -f .\logstash.conf
otherwise sudo logstash -f logstash.conf you try both coz in my i have working fine

here is the command that how to start the service and run the file:

https://www.elastic.co/guide/en/logstash/current/running-logstash.html#running-logstash-systemd

if any issue ask me

Thanks & Regards,
Krunal.


(Alpha Gamma) #7

ya I had run already thanks
I found in other thread


(Alpha Gamma) #8

thanks from hear again I found command here

sudo -u logstash /usr/share/logstash/bin/logstash --path.settings /etc/logstash -f /etc/logstash/conf.d/file.conf --config.test_and_exit


(Krunal Kalaria) #9

@alpha_gamma great..:blush::grinning:


(Alpha Gamma) #10

you are welcome ,krunal I am strange why these things are not in standard books,with new technologies requires a lot of hit and trial ,some times things very easy and some times take too much time .hahahah:grinning:


(system) #11

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