I get the error during setup of the filebeat

Hello , I installed filebeat 7.0.0 in my ubuntu vm. I did all necessary config. But , when I enter "sudo filebeat setup" command in terminal I get this output :
Index setup complete.
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
Exiting: 1 error: error loading config file: invalid config: yaml: line 10: did not find expected key

It's my filebeat.yaml file

- type: log

  enabled: true

    - /var/log/apache2/*.log
    #- c:\programdata\elasticsearch\logs\*

#============================= Filebeat modules ===============================

  path: ${path.config}/modules.d/*.yml

  reload.enabled: false

#==================== Elasticsearch template setting ==========================

  index.number_of_shards: 1

#================================ General =====================================

#============================== Dashboards =====================================
setup.dashboards.enabled: true

#============================== Kibana =====================================

  host: ""

#============================= Elastic Cloud ==================================

#================================ Outputs =====================================

#-------------------------- Elasticsearch output ------------------------------
  # Array of hosts to connect to.
  hosts: [""]
  username: "user"
  password: "hUyyIcR5rSQ6"

#----------------------------- Logstash output --------------------------------
  # The Logstash hosts
  # hosts: [""]

#================================ Processors =====================================

# Configure processors to enhance or manipulate events generated by the beat.

  - add_host_metadata: ~
  - add_cloud_metadata: ~

#================================ Logging =====================================

#============================== Xpack Monitoring ===============================

#================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true

thanks in advance.


I am using same configuration in another host (ubuntu 16.04) and filebeat setup completed without error.

@Burak_Cayir, I have also tested your config in Redhat but it has no problem. Everything is executing fine.

The error you have mentioned is mainly occurs due to indentation problem or missing parameter in filebeat.yml file. There is no such syntax related problem in your shared filebeat.yml file.

1 Like

@Debashis , thanks.

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