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

filebeat.inputs:
- type: log

  enabled: true

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

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

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

  reload.enabled: false


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

setup.template.settings:
  index.number_of_shards: 1

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


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

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

setup.kibana:
  host: "http://192.168.73.131:5601"

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

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

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

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
  # hosts: ["192.168.73.131:5044"]

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

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

processors:
  - 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.

Hello,

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.