diff options
| -rw-r--r-- | ansible/roles/alloy/templates/config.alloy.j2 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ansible/roles/alloy/templates/config.alloy.j2 b/ansible/roles/alloy/templates/config.alloy.j2 index ac27875..d0cfea1 100644 --- a/ansible/roles/alloy/templates/config.alloy.j2 +++ b/ansible/roles/alloy/templates/config.alloy.j2 @@ -1,3 +1,30 @@ +// Managed by Ansible + logging { level = "info" } + +loki.source.journal "system_journal" { + format_as_json = true + forward_to = [] +} + +loki.source.file "auth_log" { + targets = [ + {__path__ = "/var/log/auth.log"}, + ] + forward_to = [] +} + +{% for extra in alloy_extra_files %} + +local.file_match "match_{{ extra.name }}" { + path_targets = [{"__path__" = "{{ extra.path }}"}] +} + +loki.source.file "log_{{ extra.name }}" { + targets = local.file_match.match_{{ extra.name }}.targets + forward_to = [] +} + +{% endfor %} |