[systemd-devel] regular expressions in sd_journal_add_match()

Lennart Poettering lennart at poettering.net
Tue Jul 1 09:30:15 PDT 2014


On Tue, 01.07.14 17:47, Christian Hesse (list at eworm.de) wrote:

> Hello everybody,
> 
> I am using libsystemd to access the system journal. Playing with
> sd_journal_add_match() it looks like I can only match strings. Regular
> expressions are not supported, no?
> 
> Any chance to get this implemented? Or any reason not to implement this?

The string matches can be nicely optimized with hashtables and
stuff. This is different for regular expressions, for which data
structures that can optimize them are incredible hard to do. This means,
if we supported something like that, then we wouldn't be any better
than if people using our lib would do them on their own. Which is why
there's no reason to do this in the library really.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list