Filebeat is unable to read from the source directory and write to destination file


(Deepak Mudigonda) #1

Hi,
I am new to Filebeat. I am trying to read a file using filebeat and save the read content to a new file in my local system.

I have pulled the docker image from the elastic docker repository and have mounted filebeat.yml file which I've created while running the container as below:
docker run -v /home/filebeat-poc/filebeat.yml:/usr/share/filebeat/filebeat.yml docker.elastic.co/beats/filebeat:6.5.1

After the container is started with the filebeat config file which I've specified, Filebeat is not reading the content from the source file and print/save to the destination file which i have specified in the filebeat config file.

Below is my filebeat.yml file:

filebeat.inputs:

  • type: log
    paths:
    • /home/filesource/*.log
      output:
      file:
      path: "/tmp/filebeat"
      filename: filebeat
      rotate_every_kb: 1000
      number_of_files: 7

I am not able to figure out what am I doing wrong.


(Deepak Mudigonda) #3

After I've mounted the source and destination directories of the files along with docker run command, it worked. Now, Filebeat is successfully able to read from the file and write it to a file.