diff options
author | 2024-06-07 15:18:18 +0100 | |
---|---|---|
committer | 2024-06-07 16:48:18 +0100 | |
commit | cc3b036b88726ede02e478bf8287e7c9b24b7b98 (patch) | |
tree | 1c329980b643caf2c00ace57b166d0511934a1fb | |
parent | Update documentation for Alloy with Loki configuration (diff) |
Update configuration template with authentication
-rw-r--r-- | ansible/roles/alloy/templates/config.alloy.j2 | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/ansible/roles/alloy/templates/config.alloy.j2 b/ansible/roles/alloy/templates/config.alloy.j2 index d0cfea1..23b2ec0 100644 --- a/ansible/roles/alloy/templates/config.alloy.j2 +++ b/ansible/roles/alloy/templates/config.alloy.j2 @@ -6,14 +6,7 @@ logging { loki.source.journal "system_journal" { format_as_json = true - forward_to = [] -} - -loki.source.file "auth_log" { - targets = [ - {__path__ = "/var/log/auth.log"}, - ] - forward_to = [] + forward_to = [loki.write.pydis_gateway.receiver] } {% for extra in alloy_extra_files %} @@ -24,7 +17,23 @@ local.file_match "match_{{ extra.name }}" { loki.source.file "log_{{ extra.name }}" { targets = local.file_match.match_{{ extra.name }}.targets - forward_to = [] + forward_to = [loki.write.pydis_gateway.receiver] } {% endfor %} + +loki.write "pydis_gateway" { + external_labels = { + hostname = env("HOSTNAME"), + } + endpoint { + url = "{{ alloy_loki_endpoint }}/loki/api/v1/push" + basic_auth { + username = "{{ alloy_loki_user }}" + password = "{{ alloy_loki_password }}" + } + headers = { + "X-Scope-OrgID" = "1", + } + } +} |