Ansible role that installs and configures mtail-exporter.
- role: mtail
units:
- name: dpkg
target_log: "/var/log/dpkg.log"
port: 3903
parsing_params:
- total_dpkg:
help: "simple line counter in dpkg.log"
counter: total_dpkg
regular: '/$/'
act: 'total_dpkg++'
- custom:
help: "custom counter in dpkg.log"
counter: 'counts by count_type'
regular: '/^\d+-\d+.+?\s(?P<count_type>\w{3,5})/'
act: 'counts[$count_type]++'
- name: cloud-init
target_log: "/var/log/cloud-init.log"
port: 3904
parsing_params:
- total_cloud:
help: "simple line counter in cloud-init.log"
counter: total_cloud
regular: '/$/'
act: 'total_cloud++'
- name: oom
target_log: "/var/log/kern.log"
groups: 'adm'
port: 3905
parsing_params:
- kills:
help: "OOM kill events in lxc containers"
counter: lxc_oom_kills_total
counter_by: 'log_file, container_name, service_name'
regular: '/.+Task in \/lxc\/(?P<container_name>\w{3,50})\/(?P<service_name>\S+).+killed as a result of limit.+/'
act: 'lxc_oom_kills_total[getfilename()][$container_name][$service_name]++'
Param | Default | Description |
---|---|---|
mtail_setup |
full |
Setup mode. See OSSHelp KB article. |
mtail_exporter_version |
v3.0.0-rc38 |
Version used. Еhe full list can be found on github page. |
Param | Description |
---|---|
name |
Name of custom units and config file. |
target_log |
The log that the utility parses. |
port |
Listening port. |
groups |
Comma-separated list of additional groups, where exporter user needs to be added. |
parsing_params |
Parameters of parsing. |
Param | Description |
---|---|
help |
Description. |
counter |
Metric counter. |
counter_by |
List of additional labels. |
regular |
Regular expression. |
act |
Action on regex match. |
For parsing several logs at once, a separate instance of a systemd unit with a separate config is created.
...
GPL3
OSSHelp Team, see https://oss.help