All materials
alloy-config.yaml
yamlalloy-config.yaml
// Alloy configuration for Maskan Properties network assessment
// Collects logs from all Docker containers and forwards to Loki
discovery.docker "containers" {
host = "unix:///var/run/docker.sock"
}
discovery.relabel "containers" {
targets = discovery.docker.containers.targets
rule {
source_labels = ["__meta_docker_container_name"]
target_label = "container_name"
}
rule {
source_labels = ["__meta_docker_container_label_zone"]
target_label = "zone"
}
rule {
source_labels = ["__meta_docker_container_label_building"]
target_label = "building"
}
}
loki.source.docker "containers" {
host = "unix:///var/run/docker.sock"
targets = discovery.relabel.containers.output
forward_to = [loki.write.local.receiver]
}
loki.write "local" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
}