add fluentd service
This commit is contained in:
parent
3c4f505413
commit
1a745bfa22
4 changed files with 39 additions and 1 deletions
|
@ -9,6 +9,9 @@ configs:
|
||||||
esdatasource:
|
esdatasource:
|
||||||
external: true
|
external: true
|
||||||
name: "{{ esdatasource.config_name }}"
|
name: "{{ esdatasource.config_name }}"
|
||||||
|
fluentconf:
|
||||||
|
external: true
|
||||||
|
name: "{{ fluentconf.config_name }}"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
escerts:
|
escerts:
|
||||||
|
@ -96,3 +99,11 @@ services:
|
||||||
configs:
|
configs:
|
||||||
- source: esdatasource
|
- source: esdatasource
|
||||||
target: /etc/grafana/provisioning/datasources/elasticsearch.yaml
|
target: /etc/grafana/provisioning/datasources/elasticsearch.yaml
|
||||||
|
|
||||||
|
fluentd:
|
||||||
|
image: git.kun.is/pim/fluentd:1.0.1
|
||||||
|
ports:
|
||||||
|
- 24224:24224
|
||||||
|
configs:
|
||||||
|
- source: fluentconf
|
||||||
|
target: /fluentd/etc/fluent.conf
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# vi: ft=yaml
|
||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
|
|
||||||
datasources:
|
datasources:
|
18
ansible/roles/monitoring/fluent.conf.j2
Normal file
18
ansible/roles/monitoring/fluent.conf.j2
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# vi: ft=yaml
|
||||||
|
# Receive events from 24224/tcp
|
||||||
|
# This is used by log forwarding and the fluent-cat command
|
||||||
|
<source>
|
||||||
|
@type forward
|
||||||
|
port 24224
|
||||||
|
</source>
|
||||||
|
|
||||||
|
<match cool.testje>
|
||||||
|
@type elasticsearch
|
||||||
|
host maestro.dmz
|
||||||
|
port {{ elasticsearch_port }}
|
||||||
|
include_timestamp true
|
||||||
|
</match>
|
||||||
|
|
||||||
|
<system>
|
||||||
|
log_level info
|
||||||
|
</system>
|
|
@ -1,7 +1,15 @@
|
||||||
|
- name: Create fluentd config
|
||||||
|
docker_config:
|
||||||
|
name: fluentconf
|
||||||
|
data: "{{ lookup('template', '{{ role_path }}/fluent.conf.j2') }}"
|
||||||
|
use_ssh_client: true
|
||||||
|
rolling_versions: true
|
||||||
|
register: fluentconf
|
||||||
|
|
||||||
- name: Create elasticsearch data source config
|
- name: Create elasticsearch data source config
|
||||||
docker_config:
|
docker_config:
|
||||||
name: esdatasource
|
name: esdatasource
|
||||||
data: "{{ lookup('template', '{{ role_path }}/elasticsearch.yml') }}"
|
data: "{{ lookup('template', '{{ role_path }}/elasticsearch.yml.j2') }}"
|
||||||
use_ssh_client: true
|
use_ssh_client: true
|
||||||
rolling_versions: true
|
rolling_versions: true
|
||||||
register: esdatasource
|
register: esdatasource
|
||||||
|
|
Reference in a new issue