# Logstash command not found error

**URL:** <https://discuss.elastic.co/t/logstash-command-not-found-error/114797>\
**Category:** Logstash\
**Created:** [January 10, 2018, 6:47am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797 "2018-01-10T06:47:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![alpha\_gamma](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alpha\_gamma](https://discuss.elastic.co/u/alpha_gamma)\
**Post date:** [January 10, 2018, 6:47am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/1 "2018-01-10T06:47:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [January 10, 2018, 7:07am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/2 "2018-01-10T07:07:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![alpha\_gamma](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alpha\_gamma](https://discuss.elastic.co/u/alpha_gamma)\
**Post date:** [January 10, 2018, 7:13am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/3 "2018-01-10T07:13:37Z")

</div>

> [@Krunal\_kalaria](#):
>
> .\logstash -f

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

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [January 10, 2018, 7:37am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/4 "2018-01-10T07:37:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alpha\_gamma](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alpha\_gamma](https://discuss.elastic.co/u/alpha_gamma)\
**Post date:** [January 10, 2018, 7:39am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/5 "2018-01-10T07:39:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [January 10, 2018, 11:02am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/6 "2018-01-10T11:02:27Z")

</div>

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](https://www.elastic.co/guide/en/logstash/current/running-logstash.html#running-logstash-systemd)

if any issue ask me

Thanks & Regards,  
Krunal.

---

<div class="post-metadata">

**Author:** ![alpha\_gamma](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alpha\_gamma](https://discuss.elastic.co/u/alpha_gamma)\
**Post date:** [January 10, 2018, 11:03am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/7 "2018-01-10T11:03:30Z")

</div>

ya I had run already thanks  
I found in other thread

---

<div class="post-metadata">

**Author:** ![alpha\_gamma](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alpha\_gamma](https://discuss.elastic.co/u/alpha_gamma)\
**Post date:** [January 10, 2018, 11:04am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/8 "2018-01-10T11:04:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [January 10, 2018, 11:06am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/9 "2018-01-10T11:06:35Z")

</div>

@alpha_gamma great..😊😀

---

<div class="post-metadata">

**Author:** ![alpha\_gamma](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@alpha\_gamma](https://discuss.elastic.co/u/alpha_gamma)\
**Post date:** [January 10, 2018, 11:08am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/10 "2018-01-10T11:08:06Z")

</div>

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:

---

<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:** [February 7, 2018, 11:08am UTC](https://discuss.elastic.co/t/logstash-command-not-found-error/114797/11 "2018-02-07T11:08:23Z")

</div>

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