pino-splunk-events
Version:
Pino transport layer to splunk-events
32 lines (31 loc) • 1.04 kB
TypeScript
export declare type PinoLevelLabel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
export declare type SplunkSeverity = {
level: 'Critical' | 'Important' | 'Debug';
type: 'Error' | 'Warn' | 'Info';
};
export declare const LOG_VALUE_TO_LABEL: Record<number, PinoLevelLabel>;
export declare const LOG_LABEL_TO_SPLUNK_SEVERITY: Record<PinoLevelLabel, SplunkSeverity>;
export declare type PinoLog = Record<any, unknown> & {
level: number;
time: number;
};
export declare type SplunkLog = PinoLog & {
msg?: string;
account?: string;
workflowType?: string;
workflowInstance?: string;
};
export declare const isPinoLog: (value: unknown) => value is PinoLog;
export declare const isSplunkLog: (value: unknown) => value is SplunkLog;
export declare const toSplunkEvent: (log: SplunkLog) => {
severity: SplunkSeverity;
account: string | undefined;
workflow: {
type: string;
instance: string;
};
data: {
msg?: string | undefined;
time: string;
};
};