Skip to content

Instantly share code, notes, and snippets.

@fopina
Created July 9, 2019 23:58
Show Gist options
  • Save fopina/eea83d290f634566b2e68e31d9ba6a74 to your computer and use it in GitHub Desktop.
Save fopina/eea83d290f634566b2e68e31d9ba6a74 to your computer and use it in GitHub Desktop.
- hosts: all
gather_facts: True
become: True
roles:
- role: fluentbit
fluentbit_inputs:
- systemd:
- Tag: docker
- Systemd_Filter: _SYSTEMD_UNIT=docker.service
- cpu:
- Tag: cpu
- Interval_Sec: 10
- mem:
- Tag: mem
- Interval_Sec: 10
fluentbit_filters:
- record_modifier:
- Match: 'docker'
- Whitelist_key: MESSAGE
- Whitelist_key: CONTAINER_ID
- Whitelist_key: CONTAINER_NAME
- record_modifier:
- Match: 'cpu'
- Whitelist_key: cpu_p
- Whitelist_key: user_p
- Whitelist_key: system_p
- record_modifier:
- Match: 'mem'
- Whitelist_key: Mem.used
- Whitelist_key: Swap.used
- record_modifier:
- Match: '*'
- Record: 'hostname ${HOSTNAME}'
fluentbit_outputs:
- stackdriver:
- google_service_credentials: /etc/gcreds.json
- Match: '*'
tasks:
- name: copy GCP service credentials
copy:
src: google_credentials.json
dest: /etc/gcreds.json
mode: 0400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment