@@ -6,10 +6,12 @@ systend-netlogd manual page
6
6
Description
7
7
-----------
8
8
9
- Forwards messages from the journal to other hosts over the network using the Syslog
10
- Protocol (RFC 5424). It can be configured to send messages to both unicast and multicast
11
- addresses. systemd-netlogd runs with own user systemd-journal-netlog. Starts sending logs
12
- when network is up and stops sending as soon as network is down (uses sd-network).
9
+ Forwards messages from the journal to other hosts over the network using the
10
+ Syslog Protocol (RFC 5424 and RFC 3339). It can be configured to send messages
11
+ to both unicast and multicast addresses. systemd-netlogd runs with own user
12
+ systemd-journal-netlog. Starts sending logs when network is up and stops sending
13
+ as soon as network is down (uses sd-network). It reads from journal and forwards
14
+ to network one by one. It does not use any extra disk space.
13
15
14
16
Configuration
15
17
-------------
@@ -31,12 +33,24 @@ This will create a user systemd-journal-netlog
31
33
32
34
The the address string format is similar to socket units. See systemd.socket(1)
33
35
36
+ | Protocol=
37
+ Specifies whether to use udp or tcp protocol. Defaults to udp.
38
+
39
+ | LogFormat=
40
+ Specifies whether to use RFC 5424 format or RFC 3339 format. Takes one of rfc5424 or rfc3339. Defaults to rfc5424.
41
+
34
42
| Optional settings
35
43
36
44
| StructuredData=
37
45
Meta information about the syslog message, which can be used for Cloud Based
38
46
syslog servers, such as Loggly
39
- |
47
+
48
+ | UseSysLogStructuredData=
49
+ A boolean. Specifies whether to extract SYSLOG_STRUCTURED_DATA= from journal. Defaults to false.
50
+
51
+ | UseSysLogMsgId=
52
+ A boolean. Specifies whether to extract SYSLOG_MSGID= from journal. Defaults to false.
53
+
40
54
|
41
55
42
56
EXAMPLES
@@ -58,3 +72,23 @@ EXAMPLES
58
72
[Network]
59
73
Address=192.168.8.101:514
60
74
StructuredData=[1ab456b6-90bb-6578-abcd-5b734584aaaa@41058]
75
+
76
+ - Example 4. /etc/systemd/netlogd.conf
77
+
78
+ [Network]
79
+ Address=192.168.8.101:514
80
+ #Protocol=udp
81
+ LogFormat=rfc5424
82
+ UseSysLogStructuredData=yes
83
+ UseSysLogMsgId=yes
84
+
85
+ - Use case of UseSysLogStructuredData= and UseSysLogMsgId=
86
+
87
+ sd_journal_send(
88
+ "MESSAGE=%s", "Message to process",
89
+ "PRIORITY=%s", "4",
90
+ "SYSLOG_FACILITY=%s", "1",
91
+ "SYSLOG_MSGID=%s", "1011",
92
+ "SYSLOG_STRUCTURED_DATA=%s", R"([exampleSDID@32473 iut="3" eventSource="Application"])",
93
+ NULL
94
+ );
0 commit comments