# Logstash cannot find config file

**URL:** <https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491>\
**Category:** Logstash\
**Created:** [March 25, 2016, 11:17pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491 "2016-03-25T23:17:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashi\_Ravula](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Shashi\_Ravula](https://discuss.elastic.co/u/Shashi_Ravula)\
**Post date:** [March 25, 2016, 11:17pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/1 "2016-03-25T23:17:40Z")

</div>

Hi guys ,

I am trying to run logstash as a container on marathon framework (DCOS) taking input from Kafka .  
the marathon json file fetches the uri from gist which has the logstash.conf file . I can also see the conf file in the sandbox. But logstash is not able to load the conf flie .  
this is the json file for launching logstash

> ```
> {
> "id": "logstash",
> "cmd": "logstash -t -f ./logstash.conf",
> "cpus": 0.4,
> "mem": 512,
> "ports":[5000],
> "requirePorts":true,
> "instances": 1,
> "uris": [
> "https://gist.githubusercontent.com/SMR39/efc288663949a47277bc/raw/4b393fcef342ee6b1194b35463cd6179fe87e417/logstash.conf"
> ],
> "container": {
> "type": "DOCKER",
> "docker": {
> "image": "logstash:2.2",
> "network": "HOST"
> }
> }
> }
> 
> ```

The stdout looks like this

```
Starting task logstash.1fb3452b-f2db-11e5-a4e9-0242355bdcac
Error: No config files found: /logstash.conf
Can you make sure this path is a logstash config file?

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 25, 2016, 11:30pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/2 "2016-03-25T23:30:23Z")

</div>

> [@Shashi\_Ravula](#):
>
> /logstash.conf

Looks like it's not accepting the `.` before and so it's looking in root.

---

<div class="post-metadata">

**Author:** ![Shashi\_Ravula](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Shashi\_Ravula](https://discuss.elastic.co/u/Shashi_Ravula)\
**Post date:** [March 25, 2016, 11:37pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/3 "2016-03-25T23:37:32Z")

</div>

@warkolm found it its `/mnt/mesos/sandbox/logstash.conf :)` it uses a different path for docker

but I am still not able to get past

> ```
> Expected one of #, } at line 3, column 25 (byte 46) after input {  
> kafka { 
> zk_connect => 172.16
> 
> ```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 26, 2016, 12:40am UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/4 "2016-03-26T00:40:12Z")

</div>

Maybe if you past your config we can help.

---

<div class="post-metadata">

**Author:** ![Shashi\_Ravula](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Shashi\_Ravula](https://discuss.elastic.co/u/Shashi_Ravula)\
**Post date:** [March 26, 2016, 1:21am UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/5 "2016-03-26T01:21:30Z")

</div>

It's solved thank you was a double quote problem ..

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 2, 2017, 2:19pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/6 "2017-06-02T14:19:49Z")

</div>

@Shashi_Ravula how can you resolved your probleme.i still have the same error.  
C:\logstash-5.4.0\bin\>logstash -f sample.conf  
Could not find log4j2 configuration at path /logstash-5.4.0/config/log4j2.properties. Using default config which logs to console  
14:11:58.149 [LogStash::Runner] INFO logstash.agent - No config files found in path {:path=\>"C:/logstash-5.4.0/bin/sample.conf"}  
14:11:58.154 [LogStash::Runner] ERROR logstash.agent - failed to fetch pipeline configuration {:message=\>"No config files found: sample.conf. Can you make sure this path is a logstash config file?"}  
and this is config file:  
input { stdin { } }  
output {  
elasticsearch { hosts =\> ["localhost:9200"] }  
stdout { codec =\> rubydebug }  
}  
thank you for your help.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [June 2, 2017, 2:41pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/7 "2017-06-02T14:41:16Z")

</div>

@baha1, it seems that `sample.conf` is not in the `C:\logstash-5.4.0\bin` directory. Where is it? You should perhaps specify a full path to the configuration file, e.g. `logstash -f C:\path\to\sample.conf`

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 2, 2017, 2:48pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/8 "2017-06-02T14:48:04Z")

</div>

@theuntergeek thank you so match for your answer.i have the file sample.conf in C:\logstash-5.4.0\bin\sample.conf.  
that what i excute in cmd commande:  
C:\logstash-5.4.0\bin\>logstash -f sample.conf

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [June 2, 2017, 2:49pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/9 "2017-06-02T14:49:21Z")

</div>

You should still specify the full path to the configuration file. I also don't recommend keeping configuration files in the `bin` directory.

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 2, 2017, 2:51pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/10 "2017-06-02T14:51:53Z")

</div>

i have the folder logstash,so what i have to do next,tell me all the steep please.

---

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [June 2, 2017, 3:15pm UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/11 "2017-06-02T15:15:52Z")

</div>

@theuntergeek it works fine now,thanks.

---

<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:** [July 6, 2017, 4:26am UTC](https://discuss.elastic.co/t/logstash-cannot-find-config-file/45491/12 "2017-07-06T04:26:05Z")

</div>


