Hello, complete beginner with the ELK-stack here so this might be really trivial.
I'm using the docker image docker.elastic.co/beats/filebeat:7.6.0
as well as the other corresponding images of the ELK-stack all of version 7.6.0.
These are the three version of commands I'm using to try and create the container:
VER 1
docker run -d \
--name=filebeat \
--user=root \
--volume="$(pwd)/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro" \
--volume="$(pwd)/filebeat_input.log:/usr/share/filebeat/sample.log:ro" \
--volume="/var/lib/docker/containers:/var/lib/docker/containers:ro" \
--volume="/var/run/docker.sock:/var/run/docker.sock:ro" \
--link 64bc6d9b5663:elasticsearch \
docker.elastic.co/beats/filebeat:7.6.0 filebeat \
-E output.elasticsearch.hosts=["elasticsearch:9200"]
VER 1 give me this as the error response when trying to run it.
Exiting: error loading config file: config file ("filebeat.yml") must be owned by the user identifier (uid=0) or root
VER 2
So read up some and added the setup setup -strict.perms=false
docker run -d \
--name=filebeat \
--user=root \
--volume="$(pwd)/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro" \
--volume="$(pwd)/filebeat_input.log:/usr/share/filebeat/sample.log:ro" \
--volume="/var/lib/docker/containers:/var/lib/docker/containers:ro" \
--volume="/var/run/docker.sock:/var/run/docker.sock:ro" \
--link [CONTAINER_ID_ELASTICSEARCH]:elasticsearch \
docker.elastic.co/beats/filebeat:7.6.0 setup -strict.perms=false filebeat \
-E output.elasticsearch.hosts=["elasticsearch:9200"]
While VER 2 gives me this as my response:
Overwriting ILM policy is disabled. Set `setup.ilm.overwrite:true` for enabling.
Index setup finished.
Loading dashboards (Kibana must be running and reachable)
Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to http://localhost:5601/api/status fails: fail to execute the HTTP GET request: Get http://localhost:5601/api/status: dial tcp 127.0.0.1:5601: connect: connection refused. Response: .
VER 3
Thought that ok it needs to be linked to Kibana as well so added --link [CONTAINER_ID_KIBANA]:kibana \
docker run -d \
--name=filebeat \
--user=root \
--volume="$(pwd)/filebeat.docker.yml:/usr/share/filebeat/filebeat.yml:ro" \
--volume="$(pwd)/filebeat_input.log:/usr/share/filebeat/sample.log:ro" \
--volume="/var/lib/docker/containers:/var/lib/docker/containers:ro" \
--volume="/var/run/docker.sock:/var/run/docker.sock:ro" \
--link [CONTAINER_ID_ELASTICSEARCH]:elasticsearch \
--link [CONTAINER_ID_KIBANA]:kibana \
docker.elastic.co/beats/filebeat:7.6.0 filebeat \
-E output.elasticsearch.hosts=["elasticsearch:9200"]
Which gives me the same response as VER 1:
Exiting: error loading config file: config file ("filebeat.yml") must be owned by the user identifier (uid=0) or root
This is my filebeat.yml file:
filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
filebeat.inputs:
type: log
enabled: true
paths: ./sample.log
processors:
- add_cloud_metadata: ~
- add_docker_metadata: ~
output.elasticsearch:
hosts: '${localhost:elasticsearch:9200}'
All of these are based on the examples provided in https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html
Thanks in advance to anyone that can assist me,