ntpsec: loggear a loki
This commit is contained in:
parent
e9f020454c
commit
3cec0dc87f
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import { Alpine } from "../alpine.js";
|
||||
import { sudoWriteFile } from "../helpers/sudo.js";
|
||||
import { Runit } from "../runit/index.js";
|
||||
import { FluentBitParser, runitLokiLogger } from "../software/fluentbit.js";
|
||||
|
||||
export async function setupNtpsec(alpine: Alpine, runit: Runit) {
|
||||
await alpine.addPackages(["ntpsec"]);
|
||||
|
@ -48,6 +49,7 @@ server gps.ntp.br nts iburst
|
|||
"ntpsec",
|
||||
`#!/bin/sh
|
||||
exec ntpd --nice --nofork --panicgate
|
||||
`
|
||||
`,
|
||||
runitLokiLogger(FluentBitParser.Ntpsec, "ntpsec")
|
||||
);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ export enum FluentBitParser {
|
|||
Raw = "raw",
|
||||
|
||||
Forgejo = "forgejo",
|
||||
Ntpsec = "ntpsec",
|
||||
}
|
||||
|
||||
async function saveParsers(alpine: Alpine): Promise<void> {
|
||||
|
@ -51,6 +52,11 @@ async function saveParsers(alpine: Alpine): Promise<void> {
|
|||
name forgejo
|
||||
format regex
|
||||
regex ^((?<time>\\d{4}\\/\\d{2}\\/\\d{2} \\d{2}:\\d{2}:\\d{2}?) )?((?<trace>.+:.+:.+\\(\\)?) \\[(?<level>.?)\\] )?(?<message>.*?)$
|
||||
|
||||
[PARSER]
|
||||
name ntpsec
|
||||
format regex
|
||||
regex ^(?<time>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}) (?<process>.+\\[\\d+\\]): (?<component>\\w+): (?<message>.+)$
|
||||
`
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue