This also includes a basic Prometheus scrape entry point, which
currently can only be used for health checking.
We plan futher enhancement in this direction.
Also some "fixes" in regard to rsyslog code style and portability
methods.
This commit extends the impstats input module to support a new
"prometheus" format for exporting statistics. The output is
generated via statsobj.c, which already provides Prometheus-
compatible formatting.
To enable this, a new "format" config option value ("prometheus")
was added and recognized by impstats.c. When selected, impstats
invokes the appropriate statsobj function to generate output in
Prometheus exposition format.
The default behavior remains unchanged. Existing formats such as
"json" and "legacy" are not modified.
A new test has been added under tests/ to validate correct
Prometheus output generation. The test verifies that the format
header and at least one representative metric line conform to the
Prometheus text format specification.
This enhancement enables rsyslog to integrate more easily with
Prometheus-based monitoring stacks and paves the way for native
metrics scraping without external translation layers.
Change version tag from ".master" to ".daily" to better reflect its
use in the automated daily stable build process. This also aligns with
the ongoing effort to eliminate use of the "master" name throughout the
repository.
see also: https://github.com/rsyslog/rsyslog/issues/5786
When enabled, state files are deleted when the watched file is moved or
rotated away. This prevents accumulation of stale state files from
rotated logs. By default the state file is kept. Does not change
default behavior for existing inputs. The config option is available as
per-input and per-module parameter.
This commit performs a broad modernization of widely used rsyslog
macros to align with modern C practices and support automated
formatting tools like clang-format. The changes focus on improving
syntactic regularity, readability, and tooling compatibility — without
altering behavior.
Macros refactored in this commit now follow a consistent,
statement-like form with explicit trailing semicolons. Where
applicable, macro blocks that define module interfaces (`queryEtryPt`)
have been updated to use simple `if` statements instead of `else if`
chains. While this slightly increases evaluation time, the affected
functions are only called once per module during load time to register
supported interfaces — making the performance cost irrelevant in
practice.
These improvements serve multiple purposes:
- Enable reliable clang-format usage without mangling macro logic
- Simplify reasoning about macro-expanded code for human readers
- Reduce style drift and merge conflicts
- Facilitate development for contributors using assistive tools
- Support future formatting pipelines using:
1. `clang-format`
2. a post-fixup normalization script
Refactored macros:
- MODULE_TYPE_NOKEEP
- MODULE_TYPE_KEEP
- MODULE_TYPE_INPUT
- MODULE_TYPE_OUTPUT
- MODULE_TYPE_FUNCTION
- MODULE_TYPE_PARSER
- MODULE_TYPE_LIB
- DEF_IMOD_STATIC_DATA
- DEF_OMOD_STATIC_DATA
- DEF_PMOD_STATIC_DATA
- DEF_FMOD_STATIC_DATA
- DEFobjStaticHelpers
- SIMP_PROP(...)
And all `queryEtryPt()` dispatch macros:
- CODEqueryEtryPt_STD_MOD_QUERIES
- CODEqueryEtryPt_STD_OMOD_QUERIES
- CODEqueryEtryPt_STD_OMODTX_QUERIES
- CODEqueryEtryPt_STD_OMOD8_QUERIES
- CODEqueryEtryPt_TXIF_OMOD_QUERIES
- CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES
- CODEqueryEtryPt_STD_IMOD_QUERIES
- CODEqueryEtryPt_STD_CONF2_QUERIES
- CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES
- CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES
- CODEqueryEtryPt_STD_CONF2_IMOD_QUERIES
- CODEqueryEtryPt_STD_CONF2_PREPRIVDROP_QUERIES
- CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
- CODEqueryEtryPt_STD_PMOD_QUERIES
- CODEqueryEtryPt_STD_PMOD2_QUERIES
- CODEqueryEtryPt_STD_FMOD_QUERIES
- CODEqueryEtryPt_STD_SMOD_QUERIES
- CODEqueryEtryPt_doHUPWrkr
- CODEqueryEtryPt_doHUP
This general modernization reduces macro misuse, improves DX, and
lays the foundation for a robust, automated style normalization
system.
See also: https://github.com/rsyslog/rsyslog/issues/5747
This commit integrates the full history of the
rsyslog/rsyslog-docker GitHub repository into the main rsyslog
monorepo under packaging/docker/.
The merge was performed on 2025-07-12 using 'git subtree add' to
preserve all commit history in a clean and non-interleaved form.
No changes were made to the imported content during this commit.
Rationale:
- Unify Docker artifacts with the core rsyslog development
- Reduce repository fragmentation
- Improve discoverability and cross-component development
- Simplify CI integration and contributor workflow
The original rsyslog-docker repository will be archived in
read-only mode. All future work on Docker images and related
tooling will continue under packaging/docker/ in this repository.
This merge is part of a broader effort to consolidate related
rsyslog projects into a complete, maintainable monorepo.
git-subtree-dir: packaging/docker
git-subtree-mainline: 1b35859ad174894eeb51da335823ec24a7aa5f5e
git-subtree-split: 6987e9e05ae1b12549f06838c7e0662e64ebef37
This commit imports the full history of the cleaned
rsyslog-docker repository, after removing large binary blobs
via git-filter-repo. The cleaned repo was pushed to a temporary
repo:
https://github.com/rgerhards/rsyslog-docker-temp
All future development of rsyslog Docker images continues here
in packaging/docker/ as part of the unified rsyslog monorepo.
Adds Doxygen headers to runtime/statsobj.c and runtime/statsobj.h.
The comments describe how statistics objects store counters and how
GetAllStatsLines emits data. Supported output formats such as
legacy, JSON, CEE, JSON_ES and Prometheus are listed. This clarifies
the stats subsystem for future maintainers.
AI-Agent: Codex, Gemini
We received reports of log messages incorrectly referring to "imptcp" even
though the imptcp module was not loaded on the system. This caused confusion
during troubleshooting.
One such message was:
rsyslogd: imptcp cannot set keepalive intvl - ignored: Bad file descriptor
This message originated from the nsd_ptcp module, but the LogError() calls
in EnableKeepAlive() still used "imptcp" as the source name.
This is a regression introduced in commit ad1fd21, which restructured
TCP input handling and moved responsibility for keepalive setup to nsd_ptcp,
but did not update the associated log messages.
This patch corrects the affected log strings to use "nsd_ptcp", accurately
reflecting the code path that emits them.
There is no functional change; the patch improves clarity of log output and
prevents misleading diagnostics.
The actual error shown could be related to a different issue,
see also https://github.com/rsyslog/rsyslog/pull/5749