diff options
author | 2024-06-07 15:58:26 +0100 | |
---|---|---|
committer | 2024-06-07 16:48:18 +0100 | |
commit | 38666af3f65f223c558aa24551fc6792f6237661 (patch) | |
tree | f6fcf31756e842519250106902b5f917738b76f3 | |
parent | Update configuration template with authentication (diff) |
Add relabing stages to name custom log extractors
-rw-r--r-- | ansible/roles/alloy/templates/config.alloy.j2 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ansible/roles/alloy/templates/config.alloy.j2 b/ansible/roles/alloy/templates/config.alloy.j2 index 23b2ec0..aecf34c 100644 --- a/ansible/roles/alloy/templates/config.alloy.j2 +++ b/ansible/roles/alloy/templates/config.alloy.j2 @@ -17,7 +17,18 @@ local.file_match "match_{{ extra.name }}" { loki.source.file "log_{{ extra.name }}" { targets = local.file_match.match_{{ extra.name }}.targets + forward_to = [loki.process.ansible_{{ extra.name }}.receiver] +} + +loki.process "ansible_{{ extra.name }}" { forward_to = [loki.write.pydis_gateway.receiver] + + stage.static_labels { + values = { + job = "ansible_{{ extra.name }}", + log_name = "{{ extra.name }}", + } + } } {% endfor %} |