chiark / gitweb /
man: document special journal fields
[elogind.git] / man / systemd.journal-fields.xml
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
11   under the terms of the GNU General Public License as published by
12   the Free Software Foundation; either version 2 of the License, or
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
18   General Public License for more details.
19
20   You should have received a copy of the GNU General Public License
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
56                 ASCII strings, and binary formatting is used only
57                 where formatting as ASCII makes little sense. New
58                 fields may be freely defined by applications, but a
59                 few fields have special meaning. All fields with
60                 special meaning are optional.</para>
61         </refsect1>
62
63         <refsect1>
64                 <title>User Journal Fields</title>
65
66                 <para>User fields are fields that are directly passed
67                 from clients and stored in the journal.</para>
68
69                 <variablelist>
70                         <varlistentry>
71                                 <term>MESSAGE=</term>
72                                 <listitem>
73                                         <para>The human readable
74                                         message string for this
75                                         entry. This is supposed to be
76                                         the primary text shown to the
77                                         user. It is not translated,
78                                         and is not supposed to be
79                                         parsed for meta data.</para>
80                                 </listitem>
81                         </varlistentry>
82
83                         <varlistentry>
84                                 <term>MESSAGE_ID=</term>
85                                 <listitem>
86                                         <para>A 128bit message
87                                         identifier ID for recognizing
88                                         certain message types, if this
89                                         is desirable. This should
90                                         contain a 128bit id formatted
91                                         as lower-case hexadecimal
92                                         string, without any separating
93                                         dashes or suchlike. This is
94                                         recommended to be a UUID
95                                         compatible ID, but this is not
96                                         enforced, and formatted
97                                         differently. Developers can
98                                         generate a new ID for this
99                                         purpose with
100                                         <command>journalctl
101                                         --new-id</command>.</para>
102                                 </listitem>
103                         </varlistentry>
104
105                         <varlistentry>
106                                 <term>PRIORITY=</term>
107                                 <listitem>
108                                         <para>A priority value between
109                                         0 (<literal>emerg</literal>)
110                                         and 7
111                                         (<literal>debug</literal>)
112                                         formatted as decimal
113                                         string. This field is
114                                         compatible with syslog's
115                                         priority concept.</para>
116                                 </listitem>
117                         </varlistentry>
118
119                         <varlistentry>
120                                 <term>CODE_FILE=</term>
121                                 <term>CODE_LINE=</term>
122                                 <term>CODE_FUNC=</term>
123                                 <listitem>
124                                         <para>The code location
125                                         generating this message, if
126                                         known. Contains the source
127                                         file name, the line number and
128                                         the function name.</para>
129                                 </listitem>
130                         </varlistentry>
131
132                         <varlistentry>
133                                 <term>SYSLOG_FACILITY=</term>
134                                 <term>SYSLOG_IDENTIFIER=</term>
135                                 <term>SYSLOG_PID=</term>
136                                 <listitem>
137                                         <para>Syslog compatibility
138                                         fields containing the facility
139                                         (formatted as decimal string),
140                                         the identifier string
141                                         (i.e. "tag"), and the client
142                                         PID.</para>
143                                 </listitem>
144
145                         </varlistentry>
146                 </variablelist>
147         </refsect1>
148
149         <refsect1>
150                 <title>Trusted Journal Fields</title>
151
152                 <para>Fields prefixed with an underscore are trusted
153                 fields, i.e. fields that are implicitly added by the
154                 journal and cannot be altered by client code.</para>
155
156                 <variablelist>
157                         <varlistentry>
158                                 <term>_PID=</term>
159                                 <term>_UID=</term>
160                                 <term>_GID=</term>
161                                 <listitem>
162                                         <para>The process, user and
163                                         group ID of the process the
164                                         journal entry originates from
165                                         formatted as decimal
166                                         string.</para>
167                                 </listitem>
168                         </varlistentry>
169
170                         <varlistentry>
171                                 <term>_COMM=</term>
172                                 <term>_EXE=</term>
173                                 <term>_CMDLINE=</term>
174                                 <listitem>
175                                         <para>The name, the executable
176                                         path and the command line of
177                                         the process the journal entry
178                                         originates from.</para>
179                                 </listitem>
180                         </varlistentry>
181
182                         <varlistentry>
183                                 <term>_AUDIT_SESSION=</term>
184                                 <term>_AUDIT_LOGINUID=</term>
185                                 <listitem>
186                                         <para>The session and login
187                                         UID of the process the journal
188                                         entry originates from, as
189                                         maintained by the kernel audit
190                                         subsystem.</para>
191                                 </listitem>
192                         </varlistentry>
193
194                         <varlistentry>
195                                 <term>_SYSTEMD_CGROUP=</term>
196                                 <term>_SYSTEMD_SESSION=</term>
197                                 <term>_SYSTEMD_UNIT=</term>
198                                 <term>_SYSTEMD_OWNER_UID=</term>
199
200                                 <listitem>
201                                         <para>The contol group path in
202                                         the systemd hierarchy, the
203                                         systemd session ID (if any),
204                                         the systemd unit name (if any)
205                                         and the owner UID of the
206                                         systemd session (if any) of
207                                         the process the journal entry
208                                         originates from.</para>
209                                 </listitem>
210                         </varlistentry>
211
212                         <varlistentry>
213                                 <term>_SELINUX_CONTEXT=</term>
214                                 <listitem>
215                                         <para>The SELinux security
216                                         context of the process the
217                                         journal entry originates
218                                         from.</para>
219                                 </listitem>
220                         </varlistentry>
221
222                         <varlistentry>
223                                 <term>_SOURCE_REALTIME_TIMESTAMP=</term>
224                                 <listitem>
225                                         <para>The earliest trusted
226                                         timestamp of the message, if
227                                         any is known that is different
228                                         from the reception time of the
229                                         journal. The time in usec
230                                         since the epoch formatted as
231                                         decimal string.</para>
232                                 </listitem>
233                         </varlistentry>
234
235                         <varlistentry>
236                                 <term>_BOOT_ID=</term>
237                                 <listitem>
238                                         <para>The kernel boot ID for
239                                         the boot the message was
240                                         generated in, formatted as
241                                         128bit hexadecimal
242                                         string.</para>
243                                 </listitem>
244                         </varlistentry>
245
246                         <varlistentry>
247                                 <term>_MACHINE_ID=</term>
248                                 <listitem>
249                                         <para>The machine ID of the
250                                         originating host, as available
251                                         in
252                                         <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
253                                 </listitem>
254                         </varlistentry>
255
256                         <varlistentry>
257                                 <term>_HOSTNAME=</term>
258                                 <listitem>
259                                         <para>The name of the
260                                         originating host.</para>
261                                 </listitem>
262                         </varlistentry>
263                 </variablelist>
264         </refsect1>
265
266         <refsect1>
267                 <title>Address Fields</title>
268
269                 <para>During serialization into external formats the
270                 addresses of journal entries are serialized into
271                 fields prefixed with double underscores. Note that
272                 these aren't proper fields when stored in the journal,
273                 but addressing meta data of entries.</para>
274
275                 <variablelist>
276                         <varlistentry>
277                                 <term>__CURSOR=</term>
278                                 <listitem>
279                                         <para>The cursor for the
280                                         entry. A cursor is an opaque
281                                         text string that uniquely
282                                         describes the position of an
283                                         entry in the journal and is
284                                         portable across machines,
285                                         platforms and journal
286                                         files.</para>
287                                 </listitem>
288                         </varlistentry>
289
290                         <varlistentry>
291                                 <term>__REALTIME_TIMESTAMP=</term>
292                                 <listitem>
293                                         <para>The wallclock time
294                                         (CLOCK_REALTIME) at the point
295                                         in time the entry was received
296                                         by the journal. This has
297                                         different properties from
298                                         <literal>_SOURCE_REALTIME_TIMESTAMP=</literal>
299                                         as it is usually a bit later
300                                         but more likely to be
301                                         monotonic.</para>
302                                 </listitem>
303                         </varlistentry>
304
305                         <varlistentry>
306                                 <term>__MONOTONIC_TIMESTAMP=</term>
307                                 <listitem>
308                                         <para>The monotonic time
309                                         (CLOCK_MONOTONIC) at the point
310                                         in time the entry was received
311                                         by the journal. To be useful
312                                         as an address for the entry
313                                         this should be combined with
314                                         with boot ID in
315                                         <literal>_BOOT_ID=</literal>.</para>
316                                 </listitem>
317                         </varlistentry>
318                 </variablelist>
319         </refsect1>
320
321         <refsect1>
322                   <title>See Also</title>
323                   <para>
324                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
325                           <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
326                           <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
327                   </para>
328         </refsect1>
329
330 </refentry>