Properly convert document as per bbe11b0f6a/docs/sources/set-up/migrate/from-promtail.md
This commit is contained in:
parent
99c43c145e
commit
c11896c50c
1 changed files with 20 additions and 25 deletions
|
|
@ -175,39 +175,34 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# See: https://github.com/grafana/alloy/blob/bbe11b0f6a3bd3391108b2d27122c654c535dd8d/docs/sources/set-up/migrate/from-promtail.md
|
||||||
environment.etc."alloy/config.alloy" = {
|
environment.etc."alloy/config.alloy" = {
|
||||||
text = ''
|
text = ''
|
||||||
loki.relabel "journal" {
|
discovery.relabel "journal" {
|
||||||
|
targets = []
|
||||||
|
|
||||||
rule {
|
rule {
|
||||||
source_labels = ["__journal__systemd_unit"]
|
source_labels = ["__journal__systemd_unit"]
|
||||||
target_label = "unit"
|
target_label = "unit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loki.write "local" {
|
loki.source.journal "journal" {
|
||||||
|
max_age = "12h0m0s"
|
||||||
|
relabel_rules = discovery.relabel.journal.rules
|
||||||
|
forward_to = [loki.write.default.receiver]
|
||||||
|
labels = {
|
||||||
|
host = "chrysalis",
|
||||||
|
job = "systemd-journal",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.write "default" {
|
||||||
endpoint {
|
endpoint {
|
||||||
url = "http://127.0.0.1:3100/loki/api/v1/push"
|
url = "http://127.0.0.1:3100/loki/api/v1/push"
|
||||||
}
|
}
|
||||||
external_labels = {}
|
external_labels = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
loki.source.journal "journal" {
|
|
||||||
max_age = "12h0m0s"
|
|
||||||
|
|
||||||
forward_to = [loki.write.local.receiver]
|
|
||||||
|
|
||||||
labels = {
|
|
||||||
job = "systemd-journal"
|
|
||||||
host = "chrysalis"
|
|
||||||
}
|
|
||||||
|
|
||||||
relabel_rules = loki.relabel.journal.rules
|
|
||||||
|
|
||||||
legacy_position {
|
|
||||||
file = "/var/lib/grafana-agent/positions.yaml"
|
|
||||||
name = "journal"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
group = "root";
|
group = "root";
|
||||||
mode = "0644";
|
mode = "0644";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue