aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-06-07 15:58:26 +0100
committerGravatar Joe Banks <[email protected]>2024-06-07 16:48:18 +0100
commit38666af3f65f223c558aa24551fc6792f6237661 (patch)
treef6fcf31756e842519250106902b5f917738b76f3
parentUpdate configuration template with authentication (diff)
Add relabing stages to name custom log extractors
-rw-r--r--ansible/roles/alloy/templates/config.alloy.j211
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 %}