# Filebeat not reading log files from given paths

**URL:** <https://discuss.elastic.co/t/filebeat-not-reading-log-files-from-given-paths/163473>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 9, 2019, 8:32am UTC](https://discuss.elastic.co/t/filebeat-not-reading-log-files-from-given-paths/163473 "2019-01-09T08:32:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yachitha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yachitha/32/39583_2.png) [@yachitha](https://discuss.elastic.co/u/yachitha)\
**Post date:** [January 9, 2019, 8:32am UTC](https://discuss.elastic.co/t/filebeat-not-reading-log-files-from-given-paths/163473/1 "2019-01-09T08:32:42Z")

</div>

I have created a docker image with ELK stack by using docker-compose. I have used filebeat to read log files, filebeat gives output to logstash and logstash gives outputs to elasticsearch and then finally elasticsearch gives data output to kibana dashboard. I write a yaml file called "filebeat.yml" and here is my filebeat.yml file.

```
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /docker-containers/log/nginx/*.log
output.logstash:
  hosts: ["localhost:5044"]

```

When the docker image is running followings are the terminal outputs.

```
OTP-Filebeat | 2019-01-09T08:15:00.099Z	INFO	instance/beat.go:400	filebeat start running.
OTP-Filebeat | 2019-01-09T08:15:00.100Z	INFO	registrar/registrar.go:134	Loading registrar data from /usr/share/filebeat/data/registry
OTP-Filebeat | 2019-01-09T08:15:00.100Z	INFO	registrar/registrar.go:141	States Loaded from registrar: 0
OTP-Filebeat | 2019-01-09T08:15:00.100Z	INFO	crawler/crawler.go:72	Loading Inputs: 0
OTP-Filebeat | 2019-01-09T08:15:00.101Z	INFO	log/input.go:138	Configured paths: [/mnt/log/*.log]
OTP-Filebeat | 2019-01-09T08:15:00.101Z	INFO	crawler/crawler.go:106	Loading and starting Inputs completed. Enabled inputs: 0
OTP-Filebeat | 2019-01-09T08:15:00.099Z	INFO	[monitoring]	log/log.go:117	Starting metrics logging every 30s
OTP-Filebeat | 2019-01-09T08:15:00.101Z	INFO	cfgfile/reload.go:150	Config reloader started
OTP-Filebeat | 2019-01-09T08:15:00.101Z	INFO	cfgfile/reload.go:150	Config reloader started
OTP-Filebeat | 2019-01-09T08:15:00.101Z	INFO	cfgfile/reload.go:205	Loading of config files completed.
OTP-Filebeat | 2019-01-09T08:15:00.102Z	INFO	log/input.go:138	Configured paths: [/mnt/log/*.log]
OTP-Filebeat | 2019-01-09T08:15:00.102Z	INFO	input/input.go:114	Starting input of type: log; ID: 7490297193693978066 
OTP-Filebeat | 2019-01-09T08:15:00.102Z	INFO	cfgfile/reload.go:205	Loading of config files completed.

```

The **Configured paths** seems like different and logs are not propagate to kibana.

additional infos:

- I have used 4 different containers to run filebeat, logstash, elasticsearch and kibana.
- I wrote one docker-compose file to configure all docker containers.

The docker-compose.yml file as follows.

```
version: '2'
services:

  elasticsearch:
    container_name: OTP-Elasticsearch
    build:
      context: ./elasticsearch
      args:
        - ELK_VERSION=${ELK_VERSION}
    volumes:
      - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      ES_JAVA_OPTS: "-Xmx256m -Xms256m"
    networks:
      - elk

  filebeat:
    container_name: OTP-Filebeat
    build:
      context: ./filebeat
      args:
        - ELK_VERSION=${ELK_VERSION}
    volumes:
      - ./filebeat/config/filebeat.yml:/usr/share/filebeat/config/filebeat.yml:ro
    environment:
      LS_JAVA_OPTS: "-Xmx256m -Xms256m"
    networks:
      - elk
    depends_on: 
      - elasticsearch

  logstash:
    container_name: OTP-Logstash
    build:
      context: ./logstash
      args:
        - ELK_VERSION=${ELK_VERSION}
    volumes:
      - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
      - ./logstash/pipeline:/usr/share/logstash/pipeline:ro
    ports:
      - "5044:5044"
      - "9600:9600"
    environment:
      LS_JAVA_OPTS: "-Xmx256m -Xms256m"
    networks:
      - elk
    links:
      - elasticsearch
    depends_on: 
      - filebeat
      - elasticsearch

  kibana:
    container_name: OTP-Kibana
    build:
      context: ./kibana
      args:
        - ELK_VERSION=${ELK_VERSION}
    volumes:
      - ./kibana/config/:/usr/share/kibana/config:ro
    ports:
      - "5601:5601"
    networks:
      - elk
    links:
      - elasticsearch
    depends_on: 
      - elasticsearch
      - logstash

networks:
  elk:
    driver: bridge

```

I need to know how to configure log inputs to filebeat container correctly.

Thanks.

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [January 9, 2019, 7:22pm UTC](https://discuss.elastic.co/t/filebeat-not-reading-log-files-from-given-paths/163473/2 "2019-01-09T19:22:13Z")

</div>

Hello @yachitha, Looking at your config and also the log output, are you sure Filebeat read the right configuration file? I would expect us to see a `Configured paths` containing `/docker-containers`

---

<div class="post-metadata">

**Author:** ![yachitha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yachitha/32/39583_2.png) [@yachitha](https://discuss.elastic.co/u/yachitha)\
**Post date:** [January 10, 2019, 4:51am UTC](https://discuss.elastic.co/t/filebeat-not-reading-log-files-from-given-paths/163473/3 "2019-01-10T04:51:59Z")

</div>

@pierhugues thanks. I figure it out. The configuration file I wrote by my own is not running, instead the default **filebeat.yml** file running. Configured paths in default file is working that because logs are not read. Thanks again for pointing it out.

> [@yachitha](#):
>
> volumes: - ./filebeat/config/filebeat.yml:/usr/share/filebeat/config/filebeat.yml:ro

this line replaced with following.

```
volumes:- ./filebeat/config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro

```

With this configurations I was able to fix this issue.

Important: here I tried to replace default configuration file with my own **filebeat.yml** file. I have faced some permission problems and after solving them.

> docker-compose up --build

command build the image and now it's works fine.

If anyone faced to the same issue please follow the file structure of the elastic-filebeat docker image.  
Link:  
[elastic/beats-docker-github](https://github.com/elastic/beats-docker)

see the

> beats-docker/build/filebeat/config/prospectors.d/default.yml

and

> beats-docker/build/filebeat/config/filebeat.yml

you'll be able to slove the issue.

Thanks again.

---

<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, 2019, 4:52am UTC](https://discuss.elastic.co/t/filebeat-not-reading-log-files-from-given-paths/163473/4 "2019-02-07T04:52:03Z")

</div>

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