105
111
<para><function>sd_journal_add_disjunction()</function>
106
112
may be used to insert a disjunction (i.e. logical OR)
107
113
in the match list. If this call is invoked all
108
previously added matches are combined in an OR with
109
all matches added afterwards, until
110
<function>sd_journal_add_disjunction()</function> is
111
invoked again to begin the next OR term. The
114
previously added matches since the last invocation of
115
<function>sd_journal_add_disjunction()</function> or
116
<function>sd_journal_add_conjunction()</function> are
117
combined in an OR with all matches added afterwards,
119
<function>sd_journal_add_disjunction()</function> or
120
<function>sd_journal_add_conjunction()</function> is
121
invoked again to begin the next OR or AND
124
<para><function>sd_journal_add_conjunction()</function>
125
may be used to insert a conjunction (i.e. logical AND)
126
in the match list. If this call is invoked all
127
previously added matches since the last invocation of
128
<function>sd_journal_add_conjunction()</function> are
129
combined in an AND with all matches added afterwards,
131
<function>sd_journal_add_conjunction()</function> is
132
invoked again to begin the next AND term. The
113
<function>sd_journal_add_match()</function> and
114
<function>sd_journal_add_disjunction()</function> may
134
<function>sd_journal_add_match()</function>,
135
<function>sd_journal_add_disjunction()</function> and
136
<function>sd_journal_add_conjunction()</function> may
115
137
be used to build complex search terms, even though
116
full logical expressions are not available.</para>
138
full logical expressions are not available. Note that
139
<function>sd_journal_add_conjunction()</function>
140
operates one level 'higher' than
141
<function>sd_journal_add_disjunction()</function>. It
142
is hence possible to build an expression of AND terms,
143
consisting of OR terms, consisting of AND terms,
144
consisting of OR terms of matches (the latter OR
145
expression is implicitly created for matches with the
146
same field name, see above).</para>
118
148
<para><function>sd_journal_flush_matches()</function>
119
may be used to flush all matches and disjunction terms
120
again. After this call all filtering is removed and
121
all entries in the journal will be iterated
149
may be used to flush all matches, disjunction and
150
conjunction terms again. After this call all filtering
151
is removed and all entries in the journal will be
152
iterated again.</para>
124
154
<para>Note that filtering via matches only applies to
125
155
the way the journal is read, it has no effect on storage
130
160
<title>Return Value</title>
132
<para><function>sd_journal_add_match()</function> and
133
<function>sd_journal_add_disjunction()</function>
162
<para><function>sd_journal_add_match()</function>,
163
<function>sd_journal_add_disjunction()</function> and
164
<function>sd_journal_add_conjunction()</function>
134
165
return 0 on success or a negative errno-style error
135
166
code. <function>sd_journal_flush_matches()</function>
136
167
returns nothing.</para>
140
171
<title>Notes</title>
142
173
<para>The <function>sd_journal_add_match()</function>,
143
<function>sd_journal_add_disjunction()</function> and
144
<function>sd_journal_flush_matches()</function> interfaces are
145
available as shared library, which can be compiled and
174
<function>sd_journal_add_disjunction()</function>,
175
<function>sd_journal_add_conjunction()</function> and
176
<function>sd_journal_flush_matches()</function>
177
interfaces are available as shared library, which can
178
be compiled and linked to with the
147
179
<literal>libsystemd-journal</literal>
148
180
<citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>