Created: 2026-01-20 Last Updated: 2026-01-20
journalpump is a Python-based service that reads log messages from journald and forwards them to various destinations. It is designed to be a flexible and reliable log shipping solution.
- Python 3: The core language of the project.
- systemd/journald: The primary source of log messages.
- Kafka: One of the supported output destinations.
- Elasticsearch/OpenSearch: Supported output destinations for log indexing and analysis.
- AWS CloudWatch: Supported output destination for cloud-based log management.
- Google Cloud Logging: Supported output destination for cloud-based log management.
- Rsyslog: Supported output destination for traditional log forwarding.
- Websockets: Supported output destination for real-time log streaming.
- Logplex: Supported output destination for log aggregation.
- File: Supported output destination for writing logs to local files.
The project consists of a main journalpump daemon that manages one or more JournalReader instances. Each JournalReader is responsible for reading from a specific journald source, applying filters and transformations, and sending the log messages to one or more configured output "senders".
The application is configured through a JSON file, which defines the readers, senders, filters, and other settings.
The sending logic is encapsulated in LogSender classes, which are defined in the journalpump/senders directory. The journalpump/senders/base.py file contains the base LogSender class, which provides common functionality for all senders, such as message buffering, batching, and status reporting. Each specific sender implementation (e.g., kafka_sender.py, elasticsearch_opensearch_sender.py) inherits from this base class and implements the sender-specific logic for connecting to the destination and sending messages.
The project uses make to simplify the build process for different package formats.
- Debian package:
make deb - RPM package:
make rpm - Python egg:
python3 setup.py bdist_egg
The journalpump service can be run directly or as a systemd service.
- Directly:
journalpump /path/to/journalpump.json - systemd:
systemctl start journalpump.service
The project uses pytest for testing. The Makefile provides the following targets for running tests:
- Unit tests:
make unittest - System tests:
make systest - Coverage:
make coverage
To run all tests, you can use:
make unittest systest- Coding Style: The project uses
blackfor code formatting andisortfor import sorting. It also uses.flake8,.pylintrc, and.style.yapfto enforce coding style. Note that a number ofpylintchecks are disabled in the.pylintrcfile. - Dependencies: Project dependencies are managed in
requirements.txtandrequirements.dev.txt. - Pre-commit Hooks:
.pre-commit-config.yamlis present, indicating the use of pre-commit hooks to maintain code quality. The following hooks are configured:check-yaml: Checks YAML files for syntax errors.end-of-file-fixer: Ensures that files end with a newline.trailing-whitespace: Trims trailing whitespace.flake8: Checks for Python style and quality issues.black: Formats Python code.pylint: Analyzes Python code for errors and code smells.mypy: Performs static type checking.isort: Sorts Python imports.