@profullstack/threatcrush 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10999,11 +10999,16 @@ function clock(d) {
|
|
|
10999
10999
|
const pad = (n) => String(n).padStart(2, "0");
|
|
11000
11000
|
return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
|
|
11001
11001
|
}
|
|
11002
|
+
function withHost(event) {
|
|
11003
|
+
const host = event.details?.host;
|
|
11004
|
+
if (typeof host !== "string" || host === "" || host === "-") return event.message;
|
|
11005
|
+
return `${host} \xB7 ${event.message}`;
|
|
11006
|
+
}
|
|
11002
11007
|
function toLogEntry(event) {
|
|
11003
11008
|
return {
|
|
11004
11009
|
time: clock(event.timestamp),
|
|
11005
11010
|
level: event.severity.toUpperCase(),
|
|
11006
|
-
message: event
|
|
11011
|
+
message: withHost(event),
|
|
11007
11012
|
meta: event.source_ip ? `${event.module} \xB7 ${event.source_ip}` : event.module
|
|
11008
11013
|
};
|
|
11009
11014
|
}
|