X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=man%2Fsd_journal_add_match.xml;h=21a5ab13421a7bb03dacd1d2a19f4222ce845316;hp=f9ffc9132672bf587a591be9de2aff9e749a48c5;hb=9b15b7846d4de01bb5d9700a24077787e984e8ab;hpb=bb31a4ac1997c189a344caf554f34c6aabc71aa7 diff --git a/man/sd_journal_add_match.xml b/man/sd_journal_add_match.xml index f9ffc9132..21a5ab134 100644 --- a/man/sd_journal_add_match.xml +++ b/man/sd_journal_add_match.xml @@ -45,6 +45,7 @@ sd_journal_add_match sd_journal_add_disjunction + sd_journal_add_conjunction sd_journal_flush_matches Add or remove entry matches @@ -55,19 +56,24 @@ int sd_journal_add_match - sd_journal* j - const void* data + sd_journal *j + const void *data size_t size int sd_journal_add_disjunction - sd_journal* j + sd_journal *j - int sd_journal_flush_matches - sd_journal* j + int sd_journal_add_conjunction + sd_journal *j + + + + void sd_journal_flush_matches + sd_journal *j @@ -88,11 +94,11 @@ only of 0-9, A-Z and the underscore. It may not begin with two underscores or be the empty string. The value part may be any value, including binary. If a match is - applied only entries with this field set will be + applied, only entries with this field set will be iterated. Multiple matches may be active at the same - time: if they apply to different fields only entries - with both fields set like this will be iterated, if - they apply to the same fields only entries where the + time: If they apply to different fields, only entries + with both fields set like this will be iterated. If + they apply to the same fields, only entries where the field takes one of the specified values will be iterated. Well known fields are documented in systemd.journal-fields7. Whenever @@ -104,22 +110,46 @@ sd_journal_add_disjunction() may be used to insert a disjunction (i.e. logical OR) - in the match list. If this call is invoked all - previously added matches are combined in an OR with - all matches added afterwards, until - sd_journal_add_disjunction() is - invoked again to begin the next OR term. The + in the match list. If this call is invoked, all + previously added matches since the last invocation of + sd_journal_add_disjunction() or + sd_journal_add_conjunction() are + combined in an OR with all matches added afterwards, + until + sd_journal_add_disjunction() or + sd_journal_add_conjunction() is + invoked again to begin the next OR or AND + term. + + sd_journal_add_conjunction() + may be used to insert a conjunction (i.e. logical AND) + in the match list. If this call is invoked, all + previously added matches since the last invocation of + sd_journal_add_conjunction() are + combined in an AND with all matches added afterwards, + until + sd_journal_add_conjunction() is + invoked again to begin the next AND term. The combination of - sd_journal_add_match() and - sd_journal_add_disjunction() may + sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() may be used to build complex search terms, even though - full logical expressions are not available. + full logical expressions are not available. Note that + sd_journal_add_conjunction() + operates one level 'higher' than + sd_journal_add_disjunction(). It + is hence possible to build an expression of AND terms, + consisting of OR terms, consisting of AND terms, + consisting of OR terms of matches (the latter OR + expression is implicitly created for matches with the + same field name, see above). sd_journal_flush_matches() - may be used to flush all matches and disjunction terms - again. After this call all filtering is removed and - all entries in the journal will be iterated - again. + may be used to flush all matches, disjunction and + conjunction terms again. After this call all filtering + is removed and all entries in the journal will be + iterated again. Note that filtering via matches only applies to the way the journal is read, it has no effect on storage @@ -129,8 +159,9 @@ Return Value - sd_journal_add_match() and - sd_journal_add_disjunction() + sd_journal_add_match(), + sd_journal_add_disjunction() and + sd_journal_add_conjunction() return 0 on success or a negative errno-style error code. sd_journal_flush_matches() returns nothing. @@ -140,12 +171,12 @@ Notes The sd_journal_add_match(), - sd_journal_add_disjunction() and - sd_journal_flush_matches() interfaces are - available as shared library, which can be compiled and - linked to with the - libsystemd-journal - pkg-config1 + sd_journal_add_disjunction(), + sd_journal_add_conjunction() and + sd_journal_flush_matches() + interfaces are available as a shared library, which can + be compiled and linked to with the + libsystemd pkg-config1 file. @@ -162,13 +193,13 @@ ... int add_matches(sd_journal *j) { - sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service"); - sd_journal_add_match(j, "PRIORITY=0"); - sd_journal_add_match(j, "PRIORITY=1"); - sd_journal_add_match(j, "PRIORITY=2"); - sd_journal_add_match(j, "PRIORITY=3"); + sd_journal_add_match(j, "_SYSTEMD_UNIT=avahi-daemon.service", 0); + sd_journal_add_match(j, "PRIORITY=0", 0); + sd_journal_add_match(j, "PRIORITY=1", 0); + sd_journal_add_match(j, "PRIORITY=2", 0); + sd_journal_add_match(j, "PRIORITY=3", 0); sd_journal_add_disjunction(j); - sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964"); + sd_journal_add_match(j, "MESSAGE_ID=03bb1dab98ab4ecfbf6fff2738bdd964", 0); }