random() emitted a warning only to debug output when its maximum
exceeded RAND_MAX. Log the message to normal output as well so that
operators see the misconfiguration without enabling debugging.
Add a regression test verifying that both debug and standard logs
contain the warning.
AI-Agent: ChatGPT
- fixed typos, corrected small text issues, and adjusted minor wording in messageparser.rst and multi_ruleset.rst.
- removing second 'be' & changing the verb form from activate to activates.
Only updates to documentation files (.rst, .md, .txt) for minor fixes. No source code or runtime behavior is affected.
* CI: fix welcome message activation mode to make it really work
We need to run the repo-provided script to have sufficient acces rights.
Otherwise, it will not work with PRs from forked repos (which is the
norm).
Plus some robustness amendments.
* Update .github/workflows/contributor-welcome.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
intent is two-fold:
- act welcoming and provide some guidance for PR contributors
- do a bit of checking so maintainer get's an idea if this might
be a spammy account (the world is a bad place...). Also
prevent rsyslog from being used for social engineering other
repos.
This method will be improved in the future and is work in progress.
Note: rsyslog welcomes small PRs, even single typo fixes, when
they are useful to the project. We shall, however, reject frequent
single typo fixes from same account and ask them to combine the
commits. Reason is this might be a social engineering tactic to
make rsyslog itself or other repos build unrooted trust in the
account.
* docs: add rsyslog issue assistant build files
Add README and prompt used to build the external Issue Assistant that
drives rsyslog issue assistant which creates great and AI-friendly
GitHub issues. This improves triage readiness and contributor experience
without touching runtime code. The assistant itself is free via the
ChatGPT store and will be linked from documentation and other entry points.
Note that the use of the assistant directly benenfits rsyslog AI First
ecosystem which ensures high quality AI code generation support.
Before: repository had no assistant build inputs.
After: versioned prompt and README are present; assistant is distributed
externally.
Technical details:
- Add ai/rsyslog_issue_assistant/{README.md,base_prompt.txt}.
- Prompt yields ASCII-only JSON metadata plus a Markdown body aligned
with rsyslog templates; selects type, proposes repo, and adds minimal
labels (always includes needs-triage).
- Heuristics default to rsyslog/rsyslog; librelp is chosen when clearly
indicated by the report.
- No runtime, module, ABI, or testbench changes; docs-only assets.
- README points to a web helper page to be linked from CONTRIBUTING.md.
Co-authored-by: gemini-code-assist[bot]
Improve maintainability and robustness of the TCP server by clarifying
locking/ownership, tightening invariants, and simplifying queueing.
Also fix a long-standing pragma macro typo across the tree.
Impact: Internal behavior only. EPOLL re-arm now occurs while holding
pSess->mut; starvation cap counts only successful reads.
Before/After:
Before: EPOLL re-arm happened after leaving the critical section; read
starvation cap counted loop iterations; closeSess() sometimes unlocked;
select_* helpers used on non-epoll path; enqueueWork() returned status.
After: EPOLLONESHOT is re-armed before unlocking; starvation cap counts
only RS_RET_OK reads; closeSess() never unlocks; poll_* helpers replace
select_*; enqueueWork() is void (best-effort).
Technical details:
- Replace notifyReArm() with rearmIoEvent() (EPOLL_CTL_MOD with
EPOLLONESHOT|EPOLLET; asserts efd/sock; logs on failure).
- doReceive(): explicit state machine; would-block path re-arms before
unlock; close path unlocks then calls closeSess(); starvation handoff
enqueues without re-arming.
- Initialize ioDirection for listener and session descriptors; add
assert(sock >= 0) and widespread ATTR_NONNULL annotations.
- startWrkrPool(): single finalize rollback (cancel/join partial
threads; destroy cond/mutex); stopWrkrPool(): destroy cond/mutex.
- enqueueWork(): FIFO append under lock and cond signal; returns void.
- Cleanup hardening on construct failure: free ppLstn, ppLstnPort,
ppioDescrPtr; free fromHostIP on SessAccept() error.
- Non-epoll: rename select_Add/Poll/IsReady -> poll_*; RunPoll() uses
poll_* and sets sane ioDirection defaults.
- Typo fix: standardize PRAGMA_IGNORE_Wswitch_enum in header and all
users (action.c, rainerscript.c, template.c, tcpsrv.c).
Work towards full completion of the module’s interface as it exits PoC.
The new name senderid (formerly: template) matches intent (identify a
sender, not an output format) and avoids confusion. Also make state
persistence safer via atomic writes.
Merged a bit pre-completion in order to get a static analyzer fix
into the main code base. Some additional cleanup PR will follow.
State is much cleaner now than in PoC.
Impact: Configs must use senderid=; statefile is now required. Tests
and docs updated.
Before/After: action(... template="name") -> action(... senderid="name").
Technical details:
- Replace the config parameter and instance field; drop legacy template
parsing in parseSelectorAct. The module now reads only senderid=.
- Enforce required statefile (descriptor + runtime) and cache a temp
path "<statefile>.tmp" to ensure rename() is atomic. Provide a
one-time fallback build if the cache is missing (e.g., reload flow).
- Add built-in template "StdOmSenderTrack-senderid" yielding
"%fromhost-ip%" and use it as the default senderid template.
- Improve memory ownership (free cached temp path/default template) and
keep existing locking/queue semantics unchanged.
- Update tests to use senderid= and prune PoC doc note accordingly.
see also: https://github.com/rsyslog/rsyslog/issues/5599
This change introduces profile-based configuration for omhttp. Profiles
simplify setup for common backends such as Grafana Loki and Splunk HEC by
applying recommended defaults for batching, paths, formats, and retry codes.
This improves usability and avoids error-prone manual tuning.
Impact: HTTP error handling semantics are changed; retry behavior for
3xx and 4xx differs from previous releases.
Technically, HTTP status handling is refactored: transport errors and 5xx
remain retriable, while 3xx (redirection) and 4xx (client errors) are now
treated as permanent failures (`RS_RET_DATAFAIL`). Retry ruleset logic in
batch mode is clarified: if a retry ruleset is configured, messages are
queued there; otherwise, core retry is used. In single-message mode, core
retry is always used.
The new `profile` parameter applies bundled settings. The `loki` profile
enables batching, lokirest formatting, compression, and a default path of
`loki/api/v1/push`. The `hec:splunk` profile sets HEC-specific defaults
including newline batching and size limits. A new test validates the Loki
profile end-to-end. Documentation typo in imptcp parameter reference is
also fixed.
Refs: https://github.com/rsyslog/rsyslog/issues/5957
Refs: https://github.com/rsyslog/rsyslog/pull/5972
Multiple intermediate CAs were not honored because strtok() modified
the original config value at the first comma. This led to only the
first file being considered. This change preserves the original value
and validates files using a duplicate buffer.
Impact: Users can reliably specify multiple CA intermediates via
NetstreamDriverCAExtraFiles; TLS chains that require intermediates
now validate as expected. Tests added.
Before: parsing mutated the stored string, effectively truncating at
the first comma and ignoring subsequent CA files.
After: we strdup() for validation, leave the original string intact,
and set it only if all files are accessible. Error handling follows
existing RS_RET patterns; temporary buffer is freed on all paths.
Additionally, add a test (OpenSSL backend) that generates a root,
two intermediates, and leaf certs on both client and server. The test
verifies chains with openssl, aligns CN/PermittedPeer, and exercises
a full send/receive path to guard against regressions. Makefile is
updated to include the new test in TESTS and EXTRA_DIST.
Fixes: https://github.com/rsyslog/rsyslog/issues/5207
this test loses messages because of tcp unreliability, so this is
expected. We are still investigating ways to improve test performance
even in spite of this problem. As an interim solution against flakes,
we at least temporarily increase permitted loss again.
Subtree-type templates failed to set the generated string length.
Modules relying on lenStr, such as omfwd, forwarded empty frames.
Set lenStr to the subtree length and add a regression test.
AI-Agent: ChatGPT