@bsb/syslog 9.0.0 → 9.1.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/README.md +38 -25
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -14
- package/lib/plugins/observable-syslog/index.d.ts +62 -83
- package/lib/plugins/observable-syslog/index.js +32 -69
- package/lib/plugins/service-syslog-server/index.d.ts +39 -53
- package/lib/plugins/service-syslog-server/index.js +31 -35
- package/lib/schemas/observable-syslog.json +0 -106
- package/lib/schemas/observable-syslog.plugin.json +1 -107
- package/lib/schemas/service-syslog-server.json +34 -57
- package/lib/schemas/service-syslog-server.plugin.json +1 -27
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# @bsb/syslog
|
|
2
2
|
|
|
3
|
-
Syslog server and client for BSB
|
|
3
|
+
Syslog server and client plugins for BSB. Receive syslog messages from devices and forward BSB logs to syslog servers using UDP, TCP, or TLS.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Syslog server for UDP and TCP
|
|
8
|
+
- Syslog client (observable) for UDP, TCP, and TLS
|
|
9
|
+
- RFC 3164 and RFC 5424 support
|
|
10
|
+
- Event-driven processing of incoming syslog messages
|
|
11
|
+
- Log level filtering and facility configuration
|
|
4
12
|
|
|
5
13
|
## Installation
|
|
6
14
|
|
|
@@ -8,29 +16,15 @@ Syslog server and client for BSB - receive syslog messages and send logs to sysl
|
|
|
8
16
|
npm install @bsb/syslog
|
|
9
17
|
```
|
|
10
18
|
|
|
11
|
-
## Features
|
|
12
|
-
|
|
13
|
-
### Syslog Server
|
|
14
|
-
- **Receive syslog messages** - UDP/TCP protocols
|
|
15
|
-
- **RFC compliance** - Supports RFC 3164 and RFC 5424
|
|
16
|
-
- **Event emission** - Emit received messages as BSB events
|
|
17
|
-
- **Client API** - Subscribe to syslog messages from other services
|
|
18
|
-
|
|
19
|
-
### Syslog Client (Observable)
|
|
20
|
-
- **Send BSB logs to syslog** - Forward application logs
|
|
21
|
-
- **Multiple protocols** - UDP, TCP, TLS support
|
|
22
|
-
- **RFC compliance** - RFC 3164 and RFC 5424
|
|
23
|
-
- **Level filtering** - Control which log levels are sent
|
|
24
|
-
|
|
25
19
|
## Configuration
|
|
26
20
|
|
|
27
|
-
### Server
|
|
21
|
+
### Syslog Server (Service Plugin)
|
|
28
22
|
|
|
29
23
|
```yaml
|
|
30
24
|
plugins:
|
|
31
25
|
services:
|
|
32
26
|
- plugin: "@bsb/syslog"
|
|
33
|
-
service: "
|
|
27
|
+
service: "service-syslog-server"
|
|
34
28
|
enabled: true
|
|
35
29
|
config:
|
|
36
30
|
port: 514
|
|
@@ -38,13 +32,13 @@ plugins:
|
|
|
38
32
|
exclusive: false
|
|
39
33
|
```
|
|
40
34
|
|
|
41
|
-
### Client (Observable)
|
|
35
|
+
### Syslog Client (Observable Plugin)
|
|
42
36
|
|
|
43
37
|
```yaml
|
|
44
38
|
plugins:
|
|
45
39
|
observables:
|
|
46
40
|
- plugin: "@bsb/syslog"
|
|
47
|
-
observable: "
|
|
41
|
+
observable: "observable-syslog"
|
|
48
42
|
enabled: true
|
|
49
43
|
config:
|
|
50
44
|
host: "localhost"
|
|
@@ -60,16 +54,35 @@ plugins:
|
|
|
60
54
|
error: true
|
|
61
55
|
```
|
|
62
56
|
|
|
57
|
+
### Notes
|
|
58
|
+
|
|
59
|
+
- Port 514 is privileged on Unix-like systems. Use a port above 1024 if you cannot run as root.
|
|
60
|
+
- Use `facility` values 16-23 (local0-local7) for custom applications.
|
|
61
|
+
|
|
63
62
|
## Usage
|
|
64
63
|
|
|
64
|
+
Subscribe to incoming syslog messages with the server client:
|
|
65
|
+
|
|
65
66
|
```typescript
|
|
66
|
-
import {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
import { Client as SyslogServerClient } from "@bsb/syslog/lib/plugins/service-syslog-server";
|
|
68
|
+
|
|
69
|
+
const syslogClient = new SyslogServerClient(this);
|
|
70
|
+
await syslogClient.events.onEvent("onMessage", this.obs, async (obs, message) => {
|
|
71
|
+
obs.log.info("Received syslog from {host}", { host: message.host });
|
|
72
|
+
});
|
|
71
73
|
```
|
|
72
74
|
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
- Syslog Server: `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/syslog/docs/syslog-server.md`
|
|
78
|
+
- Syslog Client: `https://github.com/BetterCorp/better-service-base/blob/master/plugins/nodejs/syslog/docs/syslog-client.md`
|
|
79
|
+
These docs are used by the BSB Registry.
|
|
80
|
+
|
|
81
|
+
## Links
|
|
82
|
+
|
|
83
|
+
- GitHub: `https://github.com/BetterCorp/better-service-base/tree/master/plugins/nodejs/syslog`
|
|
84
|
+
- BSB Registry (package): `https://io.bsbcode.dev/packages/nodejs/@bsb/syslog`
|
|
85
|
+
|
|
73
86
|
## License
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
(AGPL-3.0-only OR Commercial)
|
package/lib/index.d.ts
CHANGED
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
export { SyslogMessageSchema, type SyslogMessage, SyslogServerConfigSchema, type SyslogServerConfig, Config as SyslogServerConfigClass, EventSchemas as SyslogServerEventSchemas, Plugin as SyslogServerPlugin, Client as SyslogServerClient, } from "./plugins/service-syslog-server";
|
|
28
|
-
export { SyslogClientConfigSchema, type SyslogClientConfig, Config as SyslogClientConfigClass, Plugin as SyslogClientPlugin, } from "./plugins/observable-syslog";
|
|
27
|
+
export { SyslogMessageSchema, type SyslogMessage, SyslogServerConfigSchema, type SyslogServerConfig, Config as SyslogServerConfigClass, EventSchemas as SyslogServerEventSchemas, Plugin as SyslogServerPlugin, Client as SyslogServerClient, } from "./plugins/service-syslog-server/index.js";
|
|
28
|
+
export { SyslogClientConfigSchema, type SyslogClientConfig, Config as SyslogClientConfigClass, Plugin as SyslogClientPlugin, } from "./plugins/observable-syslog/index.js";
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,18 +24,7 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.SyslogClientPlugin = exports.SyslogClientConfigClass = exports.SyslogClientConfigSchema = exports.SyslogServerClient = exports.SyslogServerPlugin = exports.SyslogServerEventSchemas = exports.SyslogServerConfigClass = exports.SyslogServerConfigSchema = exports.SyslogMessageSchema = void 0;
|
|
30
27
|
// Syslog server exports (receives syslog messages)
|
|
31
|
-
|
|
32
|
-
Object.defineProperty(exports, "SyslogMessageSchema", { enumerable: true, get: function () { return service_syslog_server_1.SyslogMessageSchema; } });
|
|
33
|
-
Object.defineProperty(exports, "SyslogServerConfigSchema", { enumerable: true, get: function () { return service_syslog_server_1.SyslogServerConfigSchema; } });
|
|
34
|
-
Object.defineProperty(exports, "SyslogServerConfigClass", { enumerable: true, get: function () { return service_syslog_server_1.Config; } });
|
|
35
|
-
Object.defineProperty(exports, "SyslogServerEventSchemas", { enumerable: true, get: function () { return service_syslog_server_1.EventSchemas; } });
|
|
36
|
-
Object.defineProperty(exports, "SyslogServerPlugin", { enumerable: true, get: function () { return service_syslog_server_1.Plugin; } });
|
|
37
|
-
Object.defineProperty(exports, "SyslogServerClient", { enumerable: true, get: function () { return service_syslog_server_1.Client; } });
|
|
28
|
+
export { SyslogMessageSchema, SyslogServerConfigSchema, Config as SyslogServerConfigClass, EventSchemas as SyslogServerEventSchemas, Plugin as SyslogServerPlugin, Client as SyslogServerClient, } from "./plugins/service-syslog-server/index.js";
|
|
38
29
|
// Syslog client observable exports (sends logs to syslog)
|
|
39
|
-
|
|
40
|
-
Object.defineProperty(exports, "SyslogClientConfigSchema", { enumerable: true, get: function () { return observable_syslog_1.SyslogClientConfigSchema; } });
|
|
41
|
-
Object.defineProperty(exports, "SyslogClientConfigClass", { enumerable: true, get: function () { return observable_syslog_1.Config; } });
|
|
42
|
-
Object.defineProperty(exports, "SyslogClientPlugin", { enumerable: true, get: function () { return observable_syslog_1.Plugin; } });
|
|
30
|
+
export { SyslogClientConfigSchema, Config as SyslogClientConfigClass, Plugin as SyslogClientPlugin, } from "./plugins/observable-syslog/index.js";
|
|
@@ -26,99 +26,78 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import { BSBObservable, BSBObservableConstructor, BSBError } from "@bsb/base";
|
|
28
28
|
import { DTrace, LogMeta } from "@bsb/base";
|
|
29
|
-
import
|
|
29
|
+
import * as av from "@anyvali/js";
|
|
30
30
|
/**
|
|
31
31
|
* Configuration schema for syslog client observable
|
|
32
32
|
*/
|
|
33
|
-
export declare const SyslogClientConfigSchema:
|
|
34
|
-
host:
|
|
35
|
-
port:
|
|
36
|
-
protocol:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
export declare const SyslogClientConfigSchema: av.ObjectSchema<{
|
|
34
|
+
host: av.OptionalSchema<av.StringSchema>;
|
|
35
|
+
port: av.OptionalSchema<av.Int32Schema>;
|
|
36
|
+
protocol: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
37
|
+
tls: av.OptionalSchema<av.ObjectSchema<{
|
|
38
|
+
rejectUnauthorized: av.OptionalSchema<av.BoolSchema>;
|
|
39
|
+
ca: av.OptionalSchema<av.StringSchema>;
|
|
40
|
+
cert: av.OptionalSchema<av.StringSchema>;
|
|
41
|
+
key: av.OptionalSchema<av.StringSchema>;
|
|
40
42
|
}>>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
facility: av.OptionalSchema<av.Int32Schema>;
|
|
44
|
+
hostname: av.OptionalSchema<av.StringSchema>;
|
|
45
|
+
appName: av.OptionalSchema<av.StringSchema>;
|
|
46
|
+
rfc: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
47
|
+
levels: av.ObjectSchema<{
|
|
48
|
+
debug: av.OptionalSchema<av.BoolSchema>;
|
|
49
|
+
info: av.OptionalSchema<av.BoolSchema>;
|
|
50
|
+
warn: av.OptionalSchema<av.BoolSchema>;
|
|
51
|
+
error: av.OptionalSchema<av.BoolSchema>;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
export type SyslogClientConfig = av.Infer<typeof SyslogClientConfigSchema>;
|
|
55
|
+
export declare const Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
|
|
56
|
+
host: av.OptionalSchema<av.StringSchema>;
|
|
57
|
+
port: av.OptionalSchema<av.Int32Schema>;
|
|
58
|
+
protocol: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
59
|
+
tls: av.OptionalSchema<av.ObjectSchema<{
|
|
60
|
+
rejectUnauthorized: av.OptionalSchema<av.BoolSchema>;
|
|
61
|
+
ca: av.OptionalSchema<av.StringSchema>;
|
|
62
|
+
cert: av.OptionalSchema<av.StringSchema>;
|
|
63
|
+
key: av.OptionalSchema<av.StringSchema>;
|
|
53
64
|
}>>;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
protocol: z.ZodDefault<z.ZodEnum<{
|
|
66
|
-
udp: "udp";
|
|
67
|
-
tcp: "tcp";
|
|
68
|
-
tls: "tls";
|
|
69
|
-
}>>;
|
|
70
|
-
tls: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
rejectUnauthorized: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
-
ca: z.ZodOptional<z.ZodString>;
|
|
73
|
-
cert: z.ZodOptional<z.ZodString>;
|
|
74
|
-
key: z.ZodOptional<z.ZodString>;
|
|
75
|
-
}, z.core.$strip>>;
|
|
76
|
-
facility: z.ZodDefault<z.ZodNumber>;
|
|
77
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
78
|
-
appName: z.ZodDefault<z.ZodString>;
|
|
79
|
-
rfc: z.ZodDefault<z.ZodEnum<{
|
|
80
|
-
3164: "3164";
|
|
81
|
-
5424: "5424";
|
|
82
|
-
}>>;
|
|
83
|
-
levels: z.ZodObject<{
|
|
84
|
-
debug: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
-
info: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
-
warn: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
-
error: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
}, z.core.$strip>;
|
|
89
|
-
}, z.core.$strip>>;
|
|
65
|
+
facility: av.OptionalSchema<av.Int32Schema>;
|
|
66
|
+
hostname: av.OptionalSchema<av.StringSchema>;
|
|
67
|
+
appName: av.OptionalSchema<av.StringSchema>;
|
|
68
|
+
rfc: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
69
|
+
levels: av.ObjectSchema<{
|
|
70
|
+
debug: av.OptionalSchema<av.BoolSchema>;
|
|
71
|
+
info: av.OptionalSchema<av.BoolSchema>;
|
|
72
|
+
warn: av.OptionalSchema<av.BoolSchema>;
|
|
73
|
+
error: av.OptionalSchema<av.BoolSchema>;
|
|
74
|
+
}>;
|
|
75
|
+
}>>;
|
|
90
76
|
/**
|
|
91
77
|
* Syslog client observable plugin - sends logs to syslog servers
|
|
92
78
|
*/
|
|
93
79
|
export declare class Plugin extends BSBObservable<InstanceType<typeof Config>> {
|
|
94
|
-
static Config: import("@bsb/base").BSBPluginConfigClass<
|
|
95
|
-
host:
|
|
96
|
-
port:
|
|
97
|
-
protocol:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
80
|
+
static Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
|
|
81
|
+
host: av.OptionalSchema<av.StringSchema>;
|
|
82
|
+
port: av.OptionalSchema<av.Int32Schema>;
|
|
83
|
+
protocol: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
84
|
+
tls: av.OptionalSchema<av.ObjectSchema<{
|
|
85
|
+
rejectUnauthorized: av.OptionalSchema<av.BoolSchema>;
|
|
86
|
+
ca: av.OptionalSchema<av.StringSchema>;
|
|
87
|
+
cert: av.OptionalSchema<av.StringSchema>;
|
|
88
|
+
key: av.OptionalSchema<av.StringSchema>;
|
|
101
89
|
}>>;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
5424: "5424";
|
|
114
|
-
}>>;
|
|
115
|
-
levels: z.ZodObject<{
|
|
116
|
-
debug: z.ZodDefault<z.ZodBoolean>;
|
|
117
|
-
info: z.ZodDefault<z.ZodBoolean>;
|
|
118
|
-
warn: z.ZodDefault<z.ZodBoolean>;
|
|
119
|
-
error: z.ZodDefault<z.ZodBoolean>;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
|
-
}, z.core.$strip>>;
|
|
90
|
+
facility: av.OptionalSchema<av.Int32Schema>;
|
|
91
|
+
hostname: av.OptionalSchema<av.StringSchema>;
|
|
92
|
+
appName: av.OptionalSchema<av.StringSchema>;
|
|
93
|
+
rfc: av.OptionalSchema<av.EnumSchema<string[]>>;
|
|
94
|
+
levels: av.ObjectSchema<{
|
|
95
|
+
debug: av.OptionalSchema<av.BoolSchema>;
|
|
96
|
+
info: av.OptionalSchema<av.BoolSchema>;
|
|
97
|
+
warn: av.OptionalSchema<av.BoolSchema>;
|
|
98
|
+
error: av.OptionalSchema<av.BoolSchema>;
|
|
99
|
+
}>;
|
|
100
|
+
}>>;
|
|
122
101
|
private logFormatter;
|
|
123
102
|
private client;
|
|
124
103
|
private isDisposed;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,77 +24,42 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
32
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
33
|
-
}
|
|
34
|
-
Object.defineProperty(o, k2, desc);
|
|
35
|
-
}) : (function(o, m, k, k2) {
|
|
36
|
-
if (k2 === undefined) k2 = k;
|
|
37
|
-
o[k2] = m[k];
|
|
38
|
-
}));
|
|
39
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
40
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
41
|
-
}) : function(o, v) {
|
|
42
|
-
o["default"] = v;
|
|
43
|
-
});
|
|
44
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
45
|
-
var ownKeys = function(o) {
|
|
46
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
47
|
-
var ar = [];
|
|
48
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
49
|
-
return ar;
|
|
50
|
-
};
|
|
51
|
-
return ownKeys(o);
|
|
52
|
-
};
|
|
53
|
-
return function (mod) {
|
|
54
|
-
if (mod && mod.__esModule) return mod;
|
|
55
|
-
var result = {};
|
|
56
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
57
|
-
__setModuleDefault(result, mod);
|
|
58
|
-
return result;
|
|
59
|
-
};
|
|
60
|
-
})();
|
|
61
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.Plugin = exports.Config = exports.SyslogClientConfigSchema = void 0;
|
|
63
|
-
const base_1 = require("@bsb/base");
|
|
64
|
-
const zod_1 = require("zod");
|
|
27
|
+
import { BSBObservable, createConfigSchema, LogFormatter, BSBError } from "@bsb/base";
|
|
28
|
+
import * as av from "@anyvali/js";
|
|
29
|
+
import { hostname } from "node:os";
|
|
65
30
|
// @ts-ignore - no types available
|
|
66
|
-
|
|
31
|
+
import * as SyslogClient from "syslog-client";
|
|
67
32
|
/**
|
|
68
33
|
* Configuration schema for syslog client observable
|
|
69
34
|
*/
|
|
70
|
-
|
|
71
|
-
host:
|
|
72
|
-
port:
|
|
73
|
-
protocol:
|
|
74
|
-
tls:
|
|
75
|
-
rejectUnauthorized:
|
|
76
|
-
ca:
|
|
77
|
-
cert:
|
|
78
|
-
key:
|
|
79
|
-
})
|
|
80
|
-
facility:
|
|
81
|
-
hostname:
|
|
82
|
-
appName:
|
|
83
|
-
rfc:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
exports.Config = (0, base_1.createConfigSchema)({
|
|
35
|
+
export const SyslogClientConfigSchema = av.object({
|
|
36
|
+
host: av.optional(av.string()).default("localhost"),
|
|
37
|
+
port: av.optional(av.int32().min(1).max(65535)).default(514),
|
|
38
|
+
protocol: av.optional(av.enum_(["udp", "tcp", "tls"])).default("udp"),
|
|
39
|
+
tls: av.optional(av.object({
|
|
40
|
+
rejectUnauthorized: av.optional(av.bool()).default(true),
|
|
41
|
+
ca: av.optional(av.string()),
|
|
42
|
+
cert: av.optional(av.string()),
|
|
43
|
+
key: av.optional(av.string()),
|
|
44
|
+
}, { unknownKeys: "strip" })),
|
|
45
|
+
facility: av.optional(av.int32().min(0).max(23)).default(16),
|
|
46
|
+
hostname: av.optional(av.string()),
|
|
47
|
+
appName: av.optional(av.string()).default("bsb-app"),
|
|
48
|
+
rfc: av.optional(av.enum_(["3164", "5424"])).default("5424"),
|
|
49
|
+
levels: av.object({
|
|
50
|
+
debug: av.optional(av.bool()).default(true),
|
|
51
|
+
info: av.optional(av.bool()).default(true),
|
|
52
|
+
warn: av.optional(av.bool()).default(true),
|
|
53
|
+
error: av.optional(av.bool()).default(true),
|
|
54
|
+
}, { unknownKeys: "strip" }),
|
|
55
|
+
}, { unknownKeys: "strip" });
|
|
56
|
+
export const Config = createConfigSchema({
|
|
93
57
|
name: 'observable-syslog',
|
|
94
58
|
description: 'Syslog client observable plugin for forwarding logs to syslog servers',
|
|
95
59
|
version: '9.0.0',
|
|
96
60
|
image: './assets/syslog-icon.png',
|
|
97
61
|
tags: ['syslog', 'logging', 'observable', 'network'],
|
|
98
|
-
},
|
|
62
|
+
}, SyslogClientConfigSchema);
|
|
99
63
|
/**
|
|
100
64
|
* Convert BSB log level to syslog severity
|
|
101
65
|
*/
|
|
@@ -118,9 +82,9 @@ function bsbLevelToSyslogSeverity(level) {
|
|
|
118
82
|
/**
|
|
119
83
|
* Syslog client observable plugin - sends logs to syslog servers
|
|
120
84
|
*/
|
|
121
|
-
class Plugin extends
|
|
122
|
-
static Config =
|
|
123
|
-
logFormatter = new
|
|
85
|
+
export class Plugin extends BSBObservable {
|
|
86
|
+
static Config = Config;
|
|
87
|
+
logFormatter = new LogFormatter();
|
|
124
88
|
client = null;
|
|
125
89
|
isDisposed = false;
|
|
126
90
|
constructor(config) {
|
|
@@ -128,7 +92,7 @@ class Plugin extends base_1.BSBObservable {
|
|
|
128
92
|
}
|
|
129
93
|
async init() {
|
|
130
94
|
const options = {
|
|
131
|
-
syslogHostname: this.config.hostname ||
|
|
95
|
+
syslogHostname: this.config.hostname || hostname(),
|
|
132
96
|
appName: this.config.appName,
|
|
133
97
|
facility: this.config.facility,
|
|
134
98
|
rfc: this.config.rfc === "3164" ? SyslogClient.RFC3164 : SyslogClient.RFC5424,
|
|
@@ -212,7 +176,7 @@ class Plugin extends base_1.BSBObservable {
|
|
|
212
176
|
if (!this.config.levels.error) {
|
|
213
177
|
return;
|
|
214
178
|
}
|
|
215
|
-
if (message instanceof
|
|
179
|
+
if (message instanceof BSBError) {
|
|
216
180
|
if (message.raw !== null) {
|
|
217
181
|
this.writeLog("error", message.raw.trace, pluginName, message.raw.message, message.raw.meta);
|
|
218
182
|
}
|
|
@@ -232,4 +196,3 @@ class Plugin extends base_1.BSBObservable {
|
|
|
232
196
|
}
|
|
233
197
|
}
|
|
234
198
|
}
|
|
235
|
-
exports.Plugin = Plugin;
|
|
@@ -26,52 +26,45 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import { BSBService, BSBServiceConstructor, BSBServiceClient } from "@bsb/base";
|
|
28
28
|
import { Observable } from "@bsb/base";
|
|
29
|
-
import
|
|
29
|
+
import * as av from "@anyvali/js";
|
|
30
30
|
/**
|
|
31
31
|
* Syslog message structure
|
|
32
32
|
*/
|
|
33
|
-
export declare const SyslogMessageSchema:
|
|
34
|
-
gatewayTime:
|
|
35
|
-
date:
|
|
36
|
-
host:
|
|
37
|
-
protocol:
|
|
38
|
-
message:
|
|
39
|
-
}
|
|
40
|
-
export type SyslogMessage =
|
|
33
|
+
export declare const SyslogMessageSchema: av.ObjectSchema<{
|
|
34
|
+
gatewayTime: av.NumberSchema;
|
|
35
|
+
date: av.NumberSchema;
|
|
36
|
+
host: av.StringSchema;
|
|
37
|
+
protocol: av.StringSchema;
|
|
38
|
+
message: av.StringSchema;
|
|
39
|
+
}>;
|
|
40
|
+
export type SyslogMessage = av.Infer<typeof SyslogMessageSchema>;
|
|
41
41
|
/**
|
|
42
42
|
* Configuration schema for syslog server
|
|
43
43
|
*/
|
|
44
|
-
export declare const SyslogServerConfigSchema:
|
|
45
|
-
port:
|
|
46
|
-
address:
|
|
47
|
-
exclusive:
|
|
48
|
-
}
|
|
49
|
-
export type SyslogServerConfig =
|
|
50
|
-
export declare const Config: import("@bsb/base").BSBPluginConfigClass<
|
|
51
|
-
port:
|
|
52
|
-
address:
|
|
53
|
-
exclusive:
|
|
54
|
-
}
|
|
44
|
+
export declare const SyslogServerConfigSchema: av.ObjectSchema<{
|
|
45
|
+
port: av.OptionalSchema<av.Int32Schema>;
|
|
46
|
+
address: av.OptionalSchema<av.StringSchema>;
|
|
47
|
+
exclusive: av.OptionalSchema<av.BoolSchema>;
|
|
48
|
+
}>;
|
|
49
|
+
export type SyslogServerConfig = av.Infer<typeof SyslogServerConfigSchema>;
|
|
50
|
+
export declare const Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
|
|
51
|
+
port: av.OptionalSchema<av.Int32Schema>;
|
|
52
|
+
address: av.OptionalSchema<av.StringSchema>;
|
|
53
|
+
exclusive: av.OptionalSchema<av.BoolSchema>;
|
|
54
|
+
}>>;
|
|
55
55
|
/**
|
|
56
56
|
* Event schemas for syslog server
|
|
57
57
|
*/
|
|
58
58
|
export declare const EventSchemas: {
|
|
59
59
|
readonly emitEvents: {
|
|
60
60
|
readonly onMessage: {
|
|
61
|
-
input: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
readonly message: import("@bsb/base").BSBStringType;
|
|
69
|
-
};
|
|
70
|
-
required: string[];
|
|
71
|
-
description?: string;
|
|
72
|
-
optional?: boolean;
|
|
73
|
-
nullable?: boolean;
|
|
74
|
-
};
|
|
61
|
+
input: av.ObjectSchema<{
|
|
62
|
+
gatewayTime: import("@bsb/base").BSBType;
|
|
63
|
+
date: import("@bsb/base").BSBType;
|
|
64
|
+
host: av.StringSchema;
|
|
65
|
+
protocol: av.StringSchema;
|
|
66
|
+
message: av.StringSchema;
|
|
67
|
+
}>;
|
|
75
68
|
description?: string;
|
|
76
69
|
readonly __brand: "fire-and-forget";
|
|
77
70
|
};
|
|
@@ -86,28 +79,21 @@ export declare const EventSchemas: {
|
|
|
86
79
|
* Syslog server service plugin - receives syslog messages
|
|
87
80
|
*/
|
|
88
81
|
export declare class Plugin extends BSBService<InstanceType<typeof Config>, typeof EventSchemas> {
|
|
89
|
-
static Config: import("@bsb/base").BSBPluginConfigClass<
|
|
90
|
-
port:
|
|
91
|
-
address:
|
|
92
|
-
exclusive:
|
|
93
|
-
}
|
|
82
|
+
static Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
|
|
83
|
+
port: av.OptionalSchema<av.Int32Schema>;
|
|
84
|
+
address: av.OptionalSchema<av.StringSchema>;
|
|
85
|
+
exclusive: av.OptionalSchema<av.BoolSchema>;
|
|
86
|
+
}>>;
|
|
94
87
|
static EventSchemas: {
|
|
95
88
|
readonly emitEvents: {
|
|
96
89
|
readonly onMessage: {
|
|
97
|
-
input: {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
readonly message: import("@bsb/base").BSBStringType;
|
|
105
|
-
};
|
|
106
|
-
required: string[];
|
|
107
|
-
description?: string;
|
|
108
|
-
optional?: boolean;
|
|
109
|
-
nullable?: boolean;
|
|
110
|
-
};
|
|
90
|
+
input: av.ObjectSchema<{
|
|
91
|
+
gatewayTime: import("@bsb/base").BSBType;
|
|
92
|
+
date: import("@bsb/base").BSBType;
|
|
93
|
+
host: av.StringSchema;
|
|
94
|
+
protocol: av.StringSchema;
|
|
95
|
+
message: av.StringSchema;
|
|
96
|
+
}>;
|
|
111
97
|
description?: string;
|
|
112
98
|
readonly __brand: "fire-and-forget";
|
|
113
99
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,48 +24,47 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const base_2 = require("@bsb/base");
|
|
27
|
+
import { BSBService, BSBServiceClient, createConfigSchema, bsb } from "@bsb/base";
|
|
28
|
+
import * as av from "@anyvali/js";
|
|
29
|
+
import { createFireAndForgetEvent } from "@bsb/base";
|
|
30
|
+
// @ts-ignore - no types available
|
|
31
|
+
import SyslogServer from "syslog-server";
|
|
34
32
|
/**
|
|
35
33
|
* Syslog message structure
|
|
36
34
|
*/
|
|
37
|
-
|
|
38
|
-
gatewayTime:
|
|
39
|
-
date:
|
|
40
|
-
host:
|
|
41
|
-
protocol:
|
|
42
|
-
message:
|
|
43
|
-
});
|
|
35
|
+
export const SyslogMessageSchema = av.object({
|
|
36
|
+
gatewayTime: av.number(),
|
|
37
|
+
date: av.number(),
|
|
38
|
+
host: av.string(),
|
|
39
|
+
protocol: av.string(),
|
|
40
|
+
message: av.string(),
|
|
41
|
+
}, { unknownKeys: "strip" });
|
|
44
42
|
/**
|
|
45
43
|
* Configuration schema for syslog server
|
|
46
44
|
*/
|
|
47
|
-
|
|
48
|
-
port:
|
|
49
|
-
address:
|
|
50
|
-
exclusive:
|
|
51
|
-
});
|
|
52
|
-
|
|
45
|
+
export const SyslogServerConfigSchema = av.object({
|
|
46
|
+
port: av.optional(av.int32().min(1).max(65535)).default(514),
|
|
47
|
+
address: av.optional(av.string()).default("0.0.0.0"),
|
|
48
|
+
exclusive: av.optional(av.bool()).default(false),
|
|
49
|
+
}, { unknownKeys: "strip" });
|
|
50
|
+
export const Config = createConfigSchema({
|
|
53
51
|
name: 'service-syslog-server',
|
|
54
52
|
description: 'Syslog server service plugin that receives messages and emits events',
|
|
55
53
|
version: '9.0.0',
|
|
56
54
|
image: './assets/syslog-icon.png',
|
|
57
55
|
tags: ['syslog', 'server', 'service', 'events'],
|
|
58
|
-
},
|
|
56
|
+
}, SyslogServerConfigSchema);
|
|
59
57
|
/**
|
|
60
58
|
* Event schemas for syslog server
|
|
61
59
|
*/
|
|
62
|
-
|
|
60
|
+
export const EventSchemas = {
|
|
63
61
|
emitEvents: {
|
|
64
|
-
onMessage:
|
|
65
|
-
gatewayTime:
|
|
66
|
-
date:
|
|
67
|
-
host:
|
|
68
|
-
protocol:
|
|
69
|
-
message:
|
|
62
|
+
onMessage: createFireAndForgetEvent(bsb.object({
|
|
63
|
+
gatewayTime: bsb.number({ description: "Gateway timestamp (epoch ms)" }),
|
|
64
|
+
date: bsb.number({ description: "Original syslog timestamp (epoch ms)" }),
|
|
65
|
+
host: bsb.string({ description: "Source host" }),
|
|
66
|
+
protocol: bsb.string({ description: "Transport protocol" }),
|
|
67
|
+
message: bsb.string({ description: "Syslog message content" }),
|
|
70
68
|
}, "Syslog message payload"), "Syslog message received from client"),
|
|
71
69
|
},
|
|
72
70
|
onEvents: {},
|
|
@@ -78,9 +76,9 @@ exports.EventSchemas = {
|
|
|
78
76
|
/**
|
|
79
77
|
* Syslog server service plugin - receives syslog messages
|
|
80
78
|
*/
|
|
81
|
-
class Plugin extends
|
|
82
|
-
static Config =
|
|
83
|
-
static EventSchemas =
|
|
79
|
+
export class Plugin extends BSBService {
|
|
80
|
+
static Config = Config;
|
|
81
|
+
static EventSchemas = EventSchemas;
|
|
84
82
|
initBeforePlugins;
|
|
85
83
|
initAfterPlugins;
|
|
86
84
|
runBeforePlugins;
|
|
@@ -89,7 +87,7 @@ class Plugin extends base_1.BSBService {
|
|
|
89
87
|
constructor(config) {
|
|
90
88
|
super({
|
|
91
89
|
...config,
|
|
92
|
-
eventSchemas:
|
|
90
|
+
eventSchemas: EventSchemas,
|
|
93
91
|
});
|
|
94
92
|
}
|
|
95
93
|
async init() {
|
|
@@ -127,11 +125,10 @@ class Plugin extends base_1.BSBService {
|
|
|
127
125
|
}
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
|
-
exports.Plugin = Plugin;
|
|
131
128
|
/**
|
|
132
129
|
* Syslog server client - allows other services to subscribe to syslog messages
|
|
133
130
|
*/
|
|
134
|
-
class Client extends
|
|
131
|
+
export class Client extends BSBServiceClient {
|
|
135
132
|
initBeforePlugins;
|
|
136
133
|
initAfterPlugins;
|
|
137
134
|
runBeforePlugins;
|
|
@@ -145,4 +142,3 @@ class Client extends base_1.BSBServiceClient {
|
|
|
145
142
|
// });
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
|
-
exports.Client = Client;
|
|
@@ -2,112 +2,6 @@
|
|
|
2
2
|
"pluginName": "observable-syslog",
|
|
3
3
|
"version": "9.0.0",
|
|
4
4
|
"events": {},
|
|
5
|
-
"configSchema": {
|
|
6
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"host": {
|
|
10
|
-
"default": "localhost",
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
|
-
"port": {
|
|
14
|
-
"default": 514,
|
|
15
|
-
"type": "integer",
|
|
16
|
-
"minimum": 1,
|
|
17
|
-
"maximum": 65535
|
|
18
|
-
},
|
|
19
|
-
"protocol": {
|
|
20
|
-
"default": "udp",
|
|
21
|
-
"type": "string",
|
|
22
|
-
"enum": [
|
|
23
|
-
"udp",
|
|
24
|
-
"tcp",
|
|
25
|
-
"tls"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"tls": {
|
|
29
|
-
"type": "object",
|
|
30
|
-
"properties": {
|
|
31
|
-
"rejectUnauthorized": {
|
|
32
|
-
"default": true,
|
|
33
|
-
"type": "boolean"
|
|
34
|
-
},
|
|
35
|
-
"ca": {
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"cert": {
|
|
39
|
-
"type": "string"
|
|
40
|
-
},
|
|
41
|
-
"key": {
|
|
42
|
-
"type": "string"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"required": [
|
|
46
|
-
"rejectUnauthorized"
|
|
47
|
-
],
|
|
48
|
-
"additionalProperties": false
|
|
49
|
-
},
|
|
50
|
-
"facility": {
|
|
51
|
-
"default": 16,
|
|
52
|
-
"type": "integer",
|
|
53
|
-
"minimum": 0,
|
|
54
|
-
"maximum": 23
|
|
55
|
-
},
|
|
56
|
-
"hostname": {
|
|
57
|
-
"type": "string"
|
|
58
|
-
},
|
|
59
|
-
"appName": {
|
|
60
|
-
"default": "bsb-app",
|
|
61
|
-
"type": "string"
|
|
62
|
-
},
|
|
63
|
-
"rfc": {
|
|
64
|
-
"default": "5424",
|
|
65
|
-
"type": "string",
|
|
66
|
-
"enum": [
|
|
67
|
-
"3164",
|
|
68
|
-
"5424"
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
"levels": {
|
|
72
|
-
"type": "object",
|
|
73
|
-
"properties": {
|
|
74
|
-
"debug": {
|
|
75
|
-
"default": true,
|
|
76
|
-
"type": "boolean"
|
|
77
|
-
},
|
|
78
|
-
"info": {
|
|
79
|
-
"default": true,
|
|
80
|
-
"type": "boolean"
|
|
81
|
-
},
|
|
82
|
-
"warn": {
|
|
83
|
-
"default": true,
|
|
84
|
-
"type": "boolean"
|
|
85
|
-
},
|
|
86
|
-
"error": {
|
|
87
|
-
"default": true,
|
|
88
|
-
"type": "boolean"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"required": [
|
|
92
|
-
"debug",
|
|
93
|
-
"info",
|
|
94
|
-
"warn",
|
|
95
|
-
"error"
|
|
96
|
-
],
|
|
97
|
-
"additionalProperties": false
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"required": [
|
|
101
|
-
"host",
|
|
102
|
-
"port",
|
|
103
|
-
"protocol",
|
|
104
|
-
"facility",
|
|
105
|
-
"appName",
|
|
106
|
-
"rfc",
|
|
107
|
-
"levels"
|
|
108
|
-
],
|
|
109
|
-
"additionalProperties": false
|
|
110
|
-
},
|
|
111
5
|
"pluginType": "observable",
|
|
112
6
|
"capabilities": {
|
|
113
7
|
"logging": {
|
|
@@ -12,111 +12,5 @@
|
|
|
12
12
|
],
|
|
13
13
|
"documentation": [],
|
|
14
14
|
"dependencies": [],
|
|
15
|
-
"image": "./assets/syslog-icon.png"
|
|
16
|
-
"configSchema": {
|
|
17
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
18
|
-
"type": "object",
|
|
19
|
-
"properties": {
|
|
20
|
-
"host": {
|
|
21
|
-
"default": "localhost",
|
|
22
|
-
"type": "string"
|
|
23
|
-
},
|
|
24
|
-
"port": {
|
|
25
|
-
"default": 514,
|
|
26
|
-
"type": "integer",
|
|
27
|
-
"minimum": 1,
|
|
28
|
-
"maximum": 65535
|
|
29
|
-
},
|
|
30
|
-
"protocol": {
|
|
31
|
-
"default": "udp",
|
|
32
|
-
"type": "string",
|
|
33
|
-
"enum": [
|
|
34
|
-
"udp",
|
|
35
|
-
"tcp",
|
|
36
|
-
"tls"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"tls": {
|
|
40
|
-
"type": "object",
|
|
41
|
-
"properties": {
|
|
42
|
-
"rejectUnauthorized": {
|
|
43
|
-
"default": true,
|
|
44
|
-
"type": "boolean"
|
|
45
|
-
},
|
|
46
|
-
"ca": {
|
|
47
|
-
"type": "string"
|
|
48
|
-
},
|
|
49
|
-
"cert": {
|
|
50
|
-
"type": "string"
|
|
51
|
-
},
|
|
52
|
-
"key": {
|
|
53
|
-
"type": "string"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"required": [
|
|
57
|
-
"rejectUnauthorized"
|
|
58
|
-
],
|
|
59
|
-
"additionalProperties": false
|
|
60
|
-
},
|
|
61
|
-
"facility": {
|
|
62
|
-
"default": 16,
|
|
63
|
-
"type": "integer",
|
|
64
|
-
"minimum": 0,
|
|
65
|
-
"maximum": 23
|
|
66
|
-
},
|
|
67
|
-
"hostname": {
|
|
68
|
-
"type": "string"
|
|
69
|
-
},
|
|
70
|
-
"appName": {
|
|
71
|
-
"default": "bsb-app",
|
|
72
|
-
"type": "string"
|
|
73
|
-
},
|
|
74
|
-
"rfc": {
|
|
75
|
-
"default": "5424",
|
|
76
|
-
"type": "string",
|
|
77
|
-
"enum": [
|
|
78
|
-
"3164",
|
|
79
|
-
"5424"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
"levels": {
|
|
83
|
-
"type": "object",
|
|
84
|
-
"properties": {
|
|
85
|
-
"debug": {
|
|
86
|
-
"default": true,
|
|
87
|
-
"type": "boolean"
|
|
88
|
-
},
|
|
89
|
-
"info": {
|
|
90
|
-
"default": true,
|
|
91
|
-
"type": "boolean"
|
|
92
|
-
},
|
|
93
|
-
"warn": {
|
|
94
|
-
"default": true,
|
|
95
|
-
"type": "boolean"
|
|
96
|
-
},
|
|
97
|
-
"error": {
|
|
98
|
-
"default": true,
|
|
99
|
-
"type": "boolean"
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"required": [
|
|
103
|
-
"debug",
|
|
104
|
-
"info",
|
|
105
|
-
"warn",
|
|
106
|
-
"error"
|
|
107
|
-
],
|
|
108
|
-
"additionalProperties": false
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"required": [
|
|
112
|
-
"host",
|
|
113
|
-
"port",
|
|
114
|
-
"protocol",
|
|
115
|
-
"facility",
|
|
116
|
-
"appName",
|
|
117
|
-
"rfc",
|
|
118
|
-
"levels"
|
|
119
|
-
],
|
|
120
|
-
"additionalProperties": false
|
|
121
|
-
}
|
|
15
|
+
"image": "./assets/syslog-icon.png"
|
|
122
16
|
}
|
|
@@ -7,68 +7,45 @@
|
|
|
7
7
|
"category": "emitEvents",
|
|
8
8
|
"description": "Syslog message received from client",
|
|
9
9
|
"inputSchema": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
10
|
+
"anyvaliVersion": "1.0",
|
|
11
|
+
"schemaVersion": "1",
|
|
12
|
+
"root": {
|
|
13
|
+
"kind": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"gatewayTime": {
|
|
16
|
+
"kind": "number"
|
|
17
|
+
},
|
|
18
|
+
"date": {
|
|
19
|
+
"kind": "number"
|
|
20
|
+
},
|
|
21
|
+
"host": {
|
|
22
|
+
"kind": "string"
|
|
23
|
+
},
|
|
24
|
+
"protocol": {
|
|
25
|
+
"kind": "string"
|
|
26
|
+
},
|
|
27
|
+
"message": {
|
|
28
|
+
"kind": "string"
|
|
29
|
+
}
|
|
17
30
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
"protocol": {
|
|
28
|
-
"description": "Transport protocol",
|
|
29
|
-
"type": "string"
|
|
30
|
-
},
|
|
31
|
-
"message": {
|
|
32
|
-
"description": "Syslog message content",
|
|
33
|
-
"type": "string"
|
|
34
|
-
}
|
|
31
|
+
"required": [
|
|
32
|
+
"gatewayTime",
|
|
33
|
+
"date",
|
|
34
|
+
"host",
|
|
35
|
+
"protocol",
|
|
36
|
+
"message"
|
|
37
|
+
],
|
|
38
|
+
"unknownKeys": "strip"
|
|
35
39
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
40
|
+
"definitions": {},
|
|
41
|
+
"extensions": {
|
|
42
|
+
"bsb": {
|
|
43
|
+
"description": "Syslog message payload"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
43
46
|
},
|
|
44
47
|
"outputSchema": null
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
|
-
"configSchema": {
|
|
48
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
49
|
-
"type": "object",
|
|
50
|
-
"properties": {
|
|
51
|
-
"port": {
|
|
52
|
-
"default": 514,
|
|
53
|
-
"type": "integer",
|
|
54
|
-
"minimum": 1,
|
|
55
|
-
"maximum": 65535
|
|
56
|
-
},
|
|
57
|
-
"address": {
|
|
58
|
-
"default": "0.0.0.0",
|
|
59
|
-
"type": "string"
|
|
60
|
-
},
|
|
61
|
-
"exclusive": {
|
|
62
|
-
"default": false,
|
|
63
|
-
"type": "boolean"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"required": [
|
|
67
|
-
"port",
|
|
68
|
-
"address",
|
|
69
|
-
"exclusive"
|
|
70
|
-
],
|
|
71
|
-
"additionalProperties": false
|
|
72
|
-
},
|
|
73
50
|
"pluginType": "service"
|
|
74
51
|
}
|
|
@@ -12,31 +12,5 @@
|
|
|
12
12
|
],
|
|
13
13
|
"documentation": [],
|
|
14
14
|
"dependencies": [],
|
|
15
|
-
"image": "./assets/syslog-icon.png"
|
|
16
|
-
"configSchema": {
|
|
17
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
18
|
-
"type": "object",
|
|
19
|
-
"properties": {
|
|
20
|
-
"port": {
|
|
21
|
-
"default": 514,
|
|
22
|
-
"type": "integer",
|
|
23
|
-
"minimum": 1,
|
|
24
|
-
"maximum": 65535
|
|
25
|
-
},
|
|
26
|
-
"address": {
|
|
27
|
-
"default": "0.0.0.0",
|
|
28
|
-
"type": "string"
|
|
29
|
-
},
|
|
30
|
-
"exclusive": {
|
|
31
|
-
"default": false,
|
|
32
|
-
"type": "boolean"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"required": [
|
|
36
|
-
"port",
|
|
37
|
-
"address",
|
|
38
|
-
"exclusive"
|
|
39
|
-
],
|
|
40
|
-
"additionalProperties": false
|
|
41
|
-
}
|
|
15
|
+
"image": "./assets/syslog-icon.png"
|
|
42
16
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsb/syslog",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.1",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"license": "(AGPL-3.0-only OR Commercial)",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "BetterCorp (PTY) Ltd",
|
|
7
|
-
"email": "
|
|
8
|
+
"email": "ninja@bettercorp.dev",
|
|
8
9
|
"url": "https://bettercorp.dev/"
|
|
9
10
|
},
|
|
10
11
|
"description": "Syslog server and client for BSB - receive syslog messages and send logs to syslog servers",
|
|
@@ -41,12 +42,12 @@
|
|
|
41
42
|
"@bsb/base": "^9.0.0"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
45
|
+
"@anyvali/js": "^0.2.0",
|
|
44
46
|
"syslog-client": "^1.1.1",
|
|
45
|
-
"syslog-server": "^1.0.1"
|
|
46
|
-
"zod": "^4.3.6"
|
|
47
|
+
"syslog-server": "^1.0.1"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@bsb/base": "
|
|
50
|
+
"@bsb/base": "^9.0.0",
|
|
50
51
|
"@types/node": "^25.0.0",
|
|
51
52
|
"mocha": "^11.0.0",
|
|
52
53
|
"typescript": "^5.9.0"
|
|
@@ -55,6 +56,5 @@
|
|
|
55
56
|
"node": ">=23.0.0",
|
|
56
57
|
"npm": ">=11.0.0"
|
|
57
58
|
},
|
|
58
|
-
"homepage": "https://io.bsbcode.dev/
|
|
59
|
+
"homepage": "https://io.bsbcode.dev/packages/nodejs/@bsb/syslog"
|
|
59
60
|
}
|
|
60
|
-
|