# Help me - How can I configure firebeat to read log files from log folder

**URL:** <https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [September 8, 2023, 10:02am UTC](https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599 "2023-09-08T10:02:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huy\_Hoang\_Le](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huy_hoang_le/32/125447_2.png) [@Huy\_Hoang\_Le](https://discuss.elastic.co/u/Huy_Hoang_Le)\
**Post date:** [September 8, 2023, 10:02am UTC](https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599/1 "2023-09-08T10:02:27Z")

</div>

I have an app that write log to .log file to a log folder that mounted from container to host.

I'm very new to ELK overall so I want filebeat to read .log files generated in that log folder. Here is my filebeat config file

```auto
logging.level: debug
logging.to_files: true
logging.files:
  path: /var/log/filebeat
  name: filebeat
  keepfiles: 7
  permissions: 0600
  
filebeat.config:
  modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false

filebeat.inputs:
- type: log
  paths:
    - /media/HDD10TB/log/*.log

processors:
# The following example enriches each event with the machine's local time zone
# offset from UTC.
#      
- add_locale:
      format: abbreviation
#
# The following example enriches each event with host metadata.
#      
- add_host_metadata: ~    

output.logstash:
   hosts: ["logstash-01:5400"]  

```

when I go to index management on Kibana I see 0 Docs count. What is the problem here? How can I solve it.?  
Thanks

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/9/99f1365acbc563bbe92c3f2d7b7b992994c68da2.png)

Here is my docker-compose.yml

```auto
version: '3.8'
services:
    es-node-01:
      # network_mode: elastic
        container_name: es-node-01
        ports:
            - '9200:9200'
            - '9300:9300'
        environment:
            - discovery.type=single-node
        image: 'docker.elastic.co/elasticsearch/elasticsearch:7.17.0'
        networks:
            - elastic
    kibana-01:
      # network_mode: elastic
        container_name: kibana-01
        ports:
            - '5601:5601'
        environment:
            - 'ELASTICSEARCH_HOSTS=http://es-node-01:9200'
        image: 'docker.elastic.co/kibana/kibana:7.17.0' 
        healthcheck:
            test: ["CMD", "curl", "-f", "kibana-01:5601"]
            interval: 50s
            timeout: 50s
            retries: 5
        depends_on:
            - es-node-01
        networks:
            - elastic 

    logstash:
        container_name: logstash-01
        volumes:
            - logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro 
            - logstash.yaml:/usr/share/logstash/config/logstash.yml:ro 
        image: 'docker.elastic.co/logstash/logstash:7.17.0'
        depends_on:   
             kibana-01:
               condition: service_healthy  
        networks:
            - elastic 

    filebeat:
        user: root
        container_name: filebeat-01
        command: --strict.perms=false
        volumes:
            - filebeat.docker.yaml:/usr/share/filebeat/filebeat.yml:ro
            - /var/lib/docker/containers:/var/lib/docker/containers:ro
            - /var/run/docker.sock:/var/run/docker.sock:ro
        image: 'docker.elastic.co/beats/filebeat:7.17.0' 
        depends_on:   
             kibana-01:
               condition: service_healthy
        networks:
            - elastic              
networks:
  elastic:
    name: elastic

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 8, 2023, 12:04pm UTC](https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599/2 "2023-09-08T12:04:27Z")

</div>

Hello and welcome,

If you are running filebeat in a docker container, the path with your logs needs to be accessible to your container.

In your filebeat you have this configuration:

```auto
filebeat.inputs:
- type: log
  paths:
    - /media/HDD10TB/log/*.log

```

But in your docker compose you are not bind mounting the `/media` path to your filebeat container.

```auto
    filebeat:
        user: root
        container_name: filebeat-01
        command: --strict.perms=false
        volumes:
            - filebeat.docker.yaml:/usr/share/filebeat/filebeat.yml:ro
            - /var/lib/docker/containers:/var/lib/docker/containers:ro
            - /var/run/docker.sock:/var/run/docker.sock:ro

```

You need to make the log path accessible to your container, this is related to docker, not filebeat itself.

---

<div class="post-metadata">

**Author:** ![Huy\_Hoang\_Le](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huy_hoang_le/32/125447_2.png) [@Huy\_Hoang\_Le](https://discuss.elastic.co/u/Huy_Hoang_Le)\
**Post date:** [September 8, 2023, 12:30pm UTC](https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599/3 "2023-09-08T12:30:13Z")

</div>

Thank you very much for your response. I will try to mount the log file to docker and will let you know if it works

---

<div class="post-metadata">

**Author:** ![Huy\_Hoang\_Le](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huy_hoang_le/32/125447_2.png) [@Huy\_Hoang\_Le](https://discuss.elastic.co/u/Huy_Hoang_Le)\
**Post date:** [September 11, 2023, 3:49am UTC](https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599/5 "2023-09-11T03:49:04Z")

</div>

Hi, there is logging.level line in filebeat.yml so is there a config to track all log level including Info, Error, Debug and Critical ?

---

<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:** [October 9, 2023, 5:50am UTC](https://discuss.elastic.co/t/help-me-how-can-i-configure-firebeat-to-read-log-files-from-log-folder/342599/6 "2023-10-09T05:50:02Z")

</div>

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