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,38 +175,33 @@ in {
|
|||
enable = true;
|
||||
};
|
||||
|
||||
# See: https://github.com/grafana/alloy/blob/bbe11b0f6a3bd3391108b2d27122c654c535dd8d/docs/sources/set-up/migrate/from-promtail.md
|
||||
environment.etc."alloy/config.alloy" = {
|
||||
text = ''
|
||||
loki.relabel "journal" {
|
||||
rule {
|
||||
source_labels = ["__journal__systemd_unit"]
|
||||
target_label = "unit"
|
||||
}
|
||||
}
|
||||
discovery.relabel "journal" {
|
||||
targets = []
|
||||
|
||||
loki.write "local" {
|
||||
endpoint {
|
||||
url = "http://127.0.0.1:3100/loki/api/v1/push"
|
||||
}
|
||||
external_labels = {}
|
||||
rule {
|
||||
source_labels = ["__journal__systemd_unit"]
|
||||
target_label = "unit"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.journal "journal" {
|
||||
max_age = "12h0m0s"
|
||||
max_age = "12h0m0s"
|
||||
relabel_rules = discovery.relabel.journal.rules
|
||||
forward_to = [loki.write.default.receiver]
|
||||
labels = {
|
||||
host = "chrysalis",
|
||||
job = "systemd-journal",
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "http://127.0.0.1:3100/loki/api/v1/push"
|
||||
}
|
||||
external_labels = {}
|
||||
}
|
||||
'';
|
||||
group = "root";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue