]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.journal-fields.xml
man: document sd_print() and friends
[thirdparty/systemd.git] / man / systemd.journal-fields.xml
CommitLineData
ffa16db0
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 This file is part of systemd.
7
8 Copyright 2010 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
ffa16db0
LP
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 18 Lesser General Public License for more details.
ffa16db0 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
ffa16db0
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
24<refentry id="systemd.journal-fields">
25
26 <refentryinfo>
27 <title>systemd.journal-fields</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd.journal-fields</refentrytitle>
42 <manvolnum>7</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd.journal-fields</refname>
47 <refpurpose>Special journal fields</refpurpose>
48 </refnamediv>
49
50 <refsect1>
51 <title>Description</title>
52
53 <para>Entries in the journal resemble an environment
54 block in their syntax, however with fields that can
55 include binary data. Primarily, fields are formatted
a8eedf49
LP
56 UTF-8 text strings, and binary formatting is used only
57 where formatting as UTF-8 text strings makes little
58 sense. New fields may freely be defined by
59 applications, but a few fields have special
60 meaning. All fields with special meanings are
61 optional.</para>
ffa16db0
LP
62 </refsect1>
63
64 <refsect1>
65 <title>User Journal Fields</title>
66
67 <para>User fields are fields that are directly passed
68 from clients and stored in the journal.</para>
69
70 <variablelist>
71 <varlistentry>
72 <term>MESSAGE=</term>
73 <listitem>
74 <para>The human readable
75 message string for this
76 entry. This is supposed to be
77 the primary text shown to the
33ba4c4b
LP
78 user. It is usually not
79 translated (but might be in
80 some cases), and is not
81 supposed to be parsed for meta
82 data.</para>
ffa16db0
LP
83 </listitem>
84 </varlistentry>
85
86 <varlistentry>
87 <term>MESSAGE_ID=</term>
88 <listitem>
89 <para>A 128bit message
90 identifier ID for recognizing
91 certain message types, if this
92 is desirable. This should
93 contain a 128bit id formatted
94 as lower-case hexadecimal
95 string, without any separating
96 dashes or suchlike. This is
97 recommended to be a UUID
98 compatible ID, but this is not
99 enforced, and formatted
100 differently. Developers can
101 generate a new ID for this
102 purpose with
103 <command>journalctl
104 --new-id</command>.</para>
105 </listitem>
106 </varlistentry>
107
108 <varlistentry>
109 <term>PRIORITY=</term>
110 <listitem>
111 <para>A priority value between
112 0 (<literal>emerg</literal>)
113 and 7
114 (<literal>debug</literal>)
115 formatted as decimal
116 string. This field is
117 compatible with syslog's
118 priority concept.</para>
119 </listitem>
120 </varlistentry>
121
122 <varlistentry>
123 <term>CODE_FILE=</term>
124 <term>CODE_LINE=</term>
125 <term>CODE_FUNC=</term>
126 <listitem>
127 <para>The code location
128 generating this message, if
129 known. Contains the source
130 file name, the line number and
131 the function name.</para>
132 </listitem>
133 </varlistentry>
134
135 <varlistentry>
136 <term>SYSLOG_FACILITY=</term>
137 <term>SYSLOG_IDENTIFIER=</term>
138 <term>SYSLOG_PID=</term>
139 <listitem>
140 <para>Syslog compatibility
141 fields containing the facility
142 (formatted as decimal string),
143 the identifier string
144 (i.e. "tag"), and the client
145 PID.</para>
146 </listitem>
147
148 </varlistentry>
149 </variablelist>
150 </refsect1>
151
152 <refsect1>
153 <title>Trusted Journal Fields</title>
154
155 <para>Fields prefixed with an underscore are trusted
156 fields, i.e. fields that are implicitly added by the
157 journal and cannot be altered by client code.</para>
158
159 <variablelist>
160 <varlistentry>
161 <term>_PID=</term>
162 <term>_UID=</term>
163 <term>_GID=</term>
164 <listitem>
165 <para>The process, user and
166 group ID of the process the
167 journal entry originates from
168 formatted as decimal
169 string.</para>
170 </listitem>
171 </varlistentry>
172
173 <varlistentry>
174 <term>_COMM=</term>
175 <term>_EXE=</term>
176 <term>_CMDLINE=</term>
177 <listitem>
178 <para>The name, the executable
179 path and the command line of
180 the process the journal entry
181 originates from.</para>
182 </listitem>
183 </varlistentry>
184
185 <varlistentry>
186 <term>_AUDIT_SESSION=</term>
187 <term>_AUDIT_LOGINUID=</term>
188 <listitem>
189 <para>The session and login
190 UID of the process the journal
191 entry originates from, as
192 maintained by the kernel audit
193 subsystem.</para>
194 </listitem>
195 </varlistentry>
196
197 <varlistentry>
198 <term>_SYSTEMD_CGROUP=</term>
199 <term>_SYSTEMD_SESSION=</term>
200 <term>_SYSTEMD_UNIT=</term>
201 <term>_SYSTEMD_OWNER_UID=</term>
202
203 <listitem>
204 <para>The contol group path in
205 the systemd hierarchy, the
206 systemd session ID (if any),
207 the systemd unit name (if any)
208 and the owner UID of the
209 systemd session (if any) of
210 the process the journal entry
211 originates from.</para>
212 </listitem>
213 </varlistentry>
214
215 <varlistentry>
216 <term>_SELINUX_CONTEXT=</term>
217 <listitem>
218 <para>The SELinux security
219 context of the process the
220 journal entry originates
221 from.</para>
222 </listitem>
223 </varlistentry>
224
225 <varlistentry>
226 <term>_SOURCE_REALTIME_TIMESTAMP=</term>
227 <listitem>
228 <para>The earliest trusted
229 timestamp of the message, if
230 any is known that is different
231 from the reception time of the
41048afa
LP
232 journal. This is the time in
233 usec since the epoch UTC
234 formatted as decimal
235 string.</para>
ffa16db0
LP
236 </listitem>
237 </varlistentry>
238
239 <varlistentry>
240 <term>_BOOT_ID=</term>
241 <listitem>
242 <para>The kernel boot ID for
243 the boot the message was
244 generated in, formatted as
245 128bit hexadecimal
246 string.</para>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry>
251 <term>_MACHINE_ID=</term>
252 <listitem>
253 <para>The machine ID of the
254 originating host, as available
255 in
256 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
257 </listitem>
258 </varlistentry>
259
260 <varlistentry>
261 <term>_HOSTNAME=</term>
262 <listitem>
263 <para>The name of the
264 originating host.</para>
265 </listitem>
266 </varlistentry>
6bc3bf5b
LP
267
268 <varlistentry>
269 <term>_TRANSPORT=</term>
270 <listitem>
271 <para>How the entry was
272 received by the journal
273 service. One of
274 <literal>driver</literal>,
275 <literal>syslog</literal>,
276 <literal>journal</literal>,
277 <literal>stdout</literal>,
278 <literal>kernel</literal> for
279 internally generated messages,
280 for those received via the
281 local syslog socket with the
282 syslog protocol, for those
283 received via the native
284 journal protocol, for the
285 those read from a services'
286 standard output or error
57da3da1
SL
287 output, and for those read
288 from the kernel, resp.
6bc3bf5b
LP
289 </para>
290 </listitem>
291 </varlistentry>
ffa16db0
LP
292 </variablelist>
293 </refsect1>
294
295 <refsect1>
296 <title>Address Fields</title>
297
298 <para>During serialization into external formats the
299 addresses of journal entries are serialized into
300 fields prefixed with double underscores. Note that
301 these aren't proper fields when stored in the journal,
302 but addressing meta data of entries.</para>
303
304 <variablelist>
305 <varlistentry>
306 <term>__CURSOR=</term>
307 <listitem>
308 <para>The cursor for the
309 entry. A cursor is an opaque
310 text string that uniquely
311 describes the position of an
312 entry in the journal and is
313 portable across machines,
314 platforms and journal
315 files.</para>
316 </listitem>
317 </varlistentry>
318
319 <varlistentry>
320 <term>__REALTIME_TIMESTAMP=</term>
321 <listitem>
322 <para>The wallclock time
323 (CLOCK_REALTIME) at the point
324 in time the entry was received
41048afa
LP
325 by the journal, in usec since
326 the epoch UTC formatted as
327 decimal string. This has
ffa16db0
LP
328 different properties from
329 <literal>_SOURCE_REALTIME_TIMESTAMP=</literal>
330 as it is usually a bit later
331 but more likely to be
332 monotonic.</para>
333 </listitem>
334 </varlistentry>
335
336 <varlistentry>
337 <term>__MONOTONIC_TIMESTAMP=</term>
338 <listitem>
339 <para>The monotonic time
340 (CLOCK_MONOTONIC) at the point
341 in time the entry was received
41048afa
LP
342 by the journal in usec
343 formatted as decimal
344 string. To be useful as an
345 address for the entry this
346 should be combined with with
347 boot ID in
ffa16db0
LP
348 <literal>_BOOT_ID=</literal>.</para>
349 </listitem>
350 </varlistentry>
351 </variablelist>
352 </refsect1>
353
354 <refsect1>
355 <title>See Also</title>
356 <para>
357 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
358 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
a8eedf49
LP
359 <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
360 <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>7</manvolnum></citerefentry>
ffa16db0
LP
361 </para>
362 </refsect1>
363
364</refentry>