67 lines
1.6 KiB
Nix
67 lines
1.6 KiB
Nix
{
|
|
services.promtail = {
|
|
enable = true;
|
|
configuration = {
|
|
clients = [ { url = "http://saga:3100/loki/api/v1/push"; } ];
|
|
positions = {
|
|
filename = "/tmp/positions.yaml";
|
|
};
|
|
|
|
scrape_configs = [
|
|
{
|
|
job_name = "journal";
|
|
journal = {
|
|
labels = {
|
|
host = "valkyrie";
|
|
job = "systemd-journal";
|
|
};
|
|
max_age = "24h";
|
|
};
|
|
relabel_configs = [
|
|
{
|
|
source_labels = [ "__journal__systemd_unit" ];
|
|
target_label = "unit";
|
|
}
|
|
];
|
|
}
|
|
{
|
|
job_name = "unbound";
|
|
static_configs = [
|
|
{
|
|
labels = {
|
|
job = "unbound";
|
|
__path__ = "/var/lib/unbound/unbound.log";
|
|
};
|
|
}
|
|
];
|
|
pipeline_stages = [
|
|
{ labeldrop = [ "filename" ]; }
|
|
{
|
|
match = {
|
|
selector = ''{job="unbound"} |~ " start | stopped |.*in-addr.arpa."'';
|
|
action = "drop";
|
|
};
|
|
}
|
|
{
|
|
match = {
|
|
selector = ''{job="unbound"} |= "reply:"'';
|
|
stages = [ { static_labels.dns = "reply"; } ];
|
|
};
|
|
}
|
|
{
|
|
match = {
|
|
selector = ''{job="unbound"} |~ "redirect |always_null|always_nxdomain"'';
|
|
stages = [ { static_labels.dns = "block"; } ];
|
|
};
|
|
}
|
|
];
|
|
}
|
|
];
|
|
|
|
server = {
|
|
grpc_listen_port = 0;
|
|
http_listen_port = 28183;
|
|
};
|
|
};
|
|
};
|
|
}
|