How to test filebeat can take log files and stdout to terminal?

This is my filebeat.yml and it is not harvesting the logs from the defined file path-

filebeat.inputs:
- type: log
  enabled: true
  paths:
     -/home/mehak/Documents/filebeat-7.4.0-linux-x86_64/logs/log2.log

  fields:
    type: other
  fields_under_root: true

output.logstash:
   hosts: ["localhost:5044"]
   index: "logstash-%{[beat.version]}-%{+yyyy.MM.dd}"

When I run in debug mode, I see this to confirm no file is harvested-

filebeat":{"harvester":{"open_files":0,"running":0}}

Please help!

Hi @Mehak_Bhargava,

Can you try to quote the path with single quotes (')?

Can you see a message about a started harvester in filebeat logs?

How are you starting filebeat? If it is started as docker you will need to mount a volume with the path from the host?

Hi, fixed the error. There needs to be a space between '-' and '/home'

The harvester was starting and I was just running this command- ./filebeat -e -d "*"

It is not started as docker, thanks!

1 Like

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