Skip to content

Commit

Permalink
Update filebeat config
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Cervello authored and teolemon committed Feb 25, 2022
1 parent d027d9e commit 5ca792e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
38 changes: 30 additions & 8 deletions conf/filebeat.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false

filebeat.autodiscover:
providers:
- type: docker
hints.enabled: true
templates:
- conditions:
contains:
docker.container.image: nginx
config:
- module: nginx
access:
enabled: true
input:
type: docker
containers:
ids: "${data.docker.container.id}"
stream: "stdout"
error:
enabled: true
input:
type: docker
containers:
ids: "${data.docker.container.id}"
stream: "stderr"

processors:
- add_docker_metadata: ~
- add_locale:
format: offset
- add_host_metadata:
netinfo.enabled: trues

# output.console:
# pretty: true

output.elasticsearch:
hosts: ["${ELASTICSEARCH_HOSTS}"]
indices:
- index: "logs-%{+yyyy.MM.dd}"

logging.json: true
logging.metrics.enabled: false
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ services:
- js_dist:/opt/product-opener/html/js/dist
- css_dist:/opt/product-opener/html/css/dist

# Logs
- ./logs/nginx/:/var/log/nginx/

# Nginx, we use templates dir to be able to use environment vars
- ./conf/nginx.conf:/etc/nginx/templates/default.conf.template

Expand Down
4 changes: 2 additions & 2 deletions docs/how-to-guides/docker-developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ make log

### Tail other logs

Other logs are automatically mounted from the containers to your `logs/` directory.

```
make tail
```
Expand All @@ -23,8 +25,6 @@ It will `tail -f` all the files present in the `logs/` directory:
* `apache2/log4perl.log`
* `apache2/modperl_error.log`
* `apache2/other_vhosts_access.log`
* `nginx/access.log`
* `nginx/error.log`

You can also simply run:
```
Expand Down

0 comments on commit 5ca792e

Please sign in to comment.