nixos-config/hosts/panopticon/promtail.nix
gwg313 5f9fb27ebb
updates
Signed-off-by: gwg313 <gwg313@pm.me>
2025-08-16 01:32:32 -04:00

49 lines
1.1 KiB
Nix

{ config, ... }:
{
systemd.tmpfiles.rules = [
"d /var/lib/promtail 0755 promtail promtail -"
];
services.promtail = {
enable = true;
configuration = {
server.http_listen_port = 9080;
server.grpc_listen_port = 0;
positions = {
filename = "/var/lib/promtail/positions.yaml";
};
clients = [
{
url = "http://localhost:3100/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
labels = {
job = "systemd-journal";
host = config.networking.hostName;
};
};
pipeline_stages = [
{
journal = {
labels = [ "_SYSTEMD_UNIT" ];
};
}
];
}
{
job_name = "sshd";
journal = {
labels = {
job = "sshd";
host = config.networking.hostName;
};
journal_filters = [ "_SYSTEMD_UNIT=sshd.service" ];
};
}
];
};
};
}