1SD_JOURNAL_GET_CATALOG(3)   sd_journal_get_catalog   SD_JOURNAL_GET_CATALOG(3)
2
3
4

NAME

6       sd_journal_get_catalog, sd_journal_get_catalog_for_message_id -
7       Retrieve message catalog entry
8

SYNOPSIS

10       #include <systemd/sd-journal.h>
11
12       int sd_journal_get_catalog(sd_journal *j, char **ret);
13
14       int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **ret);
15

DESCRIPTION

17       sd_journal_get_catalog() retrieves a message catalog entry for the
18       current journal entry. This will look up an entry in the message
19       catalog by using the "MESSAGE_ID=" field of the current journal entry.
20       Before returning the entry all journal field names in the catalog entry
21       text enclosed in "@" will be replaced by the respective field values of
22       the current entry. If a field name referenced in the message catalog
23       entry does not exist, in the current journal entry, the "@" will be
24       removed, but the field name otherwise left untouched.
25
26       sd_journal_get_catalog_for_message_id() works similar to
27       sd_journal_get_catalog() but the entry is looked up by the specified
28       message ID (no open journal context is necessary for this), and no
29       field substitution is performed.
30
31       For more information about the journal message catalog please refer to
32       the Journal Message Catalogs[1] documentation page.
33

RETURN VALUE

35       sd_journal_get_catalog() and sd_journal_get_catalog_for_message_id()
36       return 0 on success or a negative errno-style error code. If no
37       matching message catalog entry is found, -ENOENT is returned.
38
39       On successful return, ret points to a new string, which must be freed
40       with free(3).
41

NOTES

43       Function sd_journal_get_catalog() is thread-agnostic and only a single
44       thread may operate on a given sd_journal object. Function
45       sd_journal_get_catalog_for_message_id() is thread-safe.
46
47       These APIs are implemented as a shared library, which can be compiled
48       and linked to with the libsystemd pkg-config(1) file.
49

SEE ALSO

51       systemd(1), systemd.journal-fields(7), sd-journal(3),
52       sd_journal_open(3), sd_journal_next(3), sd_journal_get_data(3),
53       malloc(3)
54

NOTES

56        1. Journal Message Catalogs
57           https://www.freedesktop.org/wiki/Software/systemd/catalog
58
59
60
61systemd 239                                          SD_JOURNAL_GET_CATALOG(3)
Impressum