40 lines
883 B
Nix
40 lines
883 B
Nix
|
{ pkgs, ... }: {
|
||
|
|
||
|
|
||
|
services.promtail = {
|
||
|
enable = true;
|
||
|
configuration =
|
||
|
{
|
||
|
server = {
|
||
|
http_listen_port = 0;
|
||
|
grpc_listen_port = 0;
|
||
|
};
|
||
|
|
||
|
clients = [
|
||
|
{ url = "https//32.54.31.99:3100/api/prom/push"; }
|
||
|
];
|
||
|
|
||
|
scrape_configs = [
|
||
|
{
|
||
|
job_name = "system";
|
||
|
pipeline_stages = [
|
||
|
{ replace = { expression = "(?:[0-9]{1,3}\\.){3}([0-9]{1,3})"; replace = "***"; }; }
|
||
|
];
|
||
|
static_configs = [
|
||
|
{
|
||
|
targets = [ "localhost" ];
|
||
|
labels = {
|
||
|
job = "nginx_access_log";
|
||
|
host = "carbon";
|
||
|
agent = "promtail";
|
||
|
__path__ = "/var/log/nginx/json_access.log";
|
||
|
};
|
||
|
}
|
||
|
];
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
|