Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ jobs:
sudo apt-get update
sudo apt-get install -y libsystemd-dev libsnappy-dev

- id: disable-apparmor-for-rsyslogd
run: |
sudo ln -s /etc/apparmor.d/usr.sbin.rsyslogd /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.rsyslogd

- id: prepare-python
uses: actions/setup-python@v2
with:
Expand Down
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@ This feature requires latest version of ``python-systemd`` `with namespace suppo
Require that the logs message matches only against certain _SYSTEMD_UNITs.
If not set, we allow log events from all units.

``journald_filters`` (default ``[]``)

Journald filters in the form of <journald_field>=<value>. If not set, no filter will be applied.
Example: SYSLOG_IDENTIFIER=postgres

Refer to https://www.freedesktop.org/software/systemd/man/latest/systemd.journal-fields.html for a list of valid fields.

``flags`` (default ``LOCAL_ONLY``)

``"LOCAL_ONLY"`` opens journal on local machine only; ``"RUNTIME_ONLY"`` opens only volatile journal files;
Expand Down
3 changes: 2 additions & 1 deletion journalpump/journalpump.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ def get_reader(self, seek_to=None, reinit=False):

for unit_to_match in self.config.get("units_to_match", []):
self.journald_reader.add_match(_SYSTEMD_UNIT=unit_to_match)

for journald_filter in self.config.get("journald_filters", []):
self.journald_reader.add_match(journald_filter)
self.initialize_senders()

return self.journald_reader
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
kafka-python
kafka-python<2.0.4
requests
websockets
websockets<14.0
aiohttp-socks
python-snappy
python-socks<2.7.0
botocore
google-api-python-client
google-auth
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
packages=find_packages(exclude=["test", "systest"]),
extras_require={},
install_requires=[
"kafka-python",
"kafka-python<2.0.4",
"requests",
"websockets",
"websockets<14.0",
"aiohttp-socks",
"botocore",
"google-api-python-client",
Expand Down