339 Commits

Author SHA1 Message Date
Rainer Gerhards
fb51433919
feat: introduce mmaitag PoC with Gemini AI provider (#5754)
This commit adds the initial implementation of the `mmaitag` module,
a pluggable AI-based message classification processor.

The module supports two providers:
- `gemini`: uses the Gemini API via libcurl and JSON-C
- `gemini_mock`: a deterministic in-memory mock used for testing

Each log message is classified individually and tagged with a label
stored in a configurable message variable (default: `$.aitag`).

Included:
- Provider abstraction layer (`ai_provider.h`)
- Gemini provider with API key support (inline or via file)
- Prompt customization and input property selection
- Two regression tests: basic and invalid-key scenarios
- Sphinx documentation under `doc/configuration/modules`

Note: mmaitag is in its infancy and primarily a PoC. Future work
will improve batching, performance, and add more providers.

Refs:
- https://github.com/rsyslog/rsyslog/issues/5747 (AI-first strategy)

With the help of AI Agents: Codex, Gemini
2025-07-15 17:33:07 +02:00
Rainer Gerhards
e109e0a7d5
Add optional PCRE match module 2025-07-11 17:08:26 +02:00
Rainer Gerhards
9016f1f1b3
omsendertrack: new module
The omsendertrack module is designed to track and report statistics for
message senders across all inputs in Rsyslog. It periodically outputs a
JSON file containing information about each sender.

Note: This commit provides minimalistic basic functionality as a PoC.
We will check it's usefulness in practice and expect follow-up PRs
to enhance functionality and include feedback from early testing.

However, this module is solid, just feature limited.

see also: https://github.com/rsyslog/rsyslog/issues/5599
2025-06-04 08:42:12 +02:00
679b0b038c Initial implementation of imdtls and omdtls modules
- Extracted basic OpenSSL helper functions into own module net_ossl.h/net_ossl.c
  Both are compiled into lmnsd_ossl.
- Cleanup of OpenSSL code, fixed minor compiler and linking issues.
- Added DTLS Sender option DTLS into tcpflood for testbench.
- Add initial implementation of imdtls input module. Added to configure and makefile
- Add initial implementation of omdtls output module. Added to configure and makefile
- Add multiple basic tests for imdtls receiving data by using tcpflood.
- Add multiple send-receive test for imdtls and omdtls based on existing tls tests.
- Add timeout and sessionbreak tests for imdtls stress testing.

closes: https://github.com/rsyslog/rsyslog/issues/5211
2024-02-23 13:44:05 +01:00
Michael Biebl
5adebfbbd9 Remove no longer used --with-systemdsystemunitdir configure switch
This is a clean up following the removal of the service unit in
cfd07503ba055100a84d75d1a78a5c6cceb9fdab
2023-10-20 14:26:42 +02:00
d5ce3daa3f omazureeventhubs: Initial implementation of new output module
The output module uses Apache "Qpid Proton C API" which is a solid
AMQP protocol library implementation that can be integrated
very well into the rsyslog dev environment.

- Implemented Delivery with submitted and accepted state checking
- impstatscounter used in testcases
- saving of failed messages in a failed list with support of saving
  and restoring.
- Add testcases (requires ENV variables) to testbench
- Using application/octect-stream (binary) to send messages based on
  Microsoft Code Sample:
  https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-c-getstarted-send
  * Note original Microsoft Samplecode is not working anymore, we are using
  * QPID Proton Proactor based on
    https://github.com/apache/qpid-proton/blob/main/c/examples/send.c
- requires QPID-PROTON Version 0.13 or higher because of the proactor API
- Add EventProperties configuration parameters
- using internal array instead of linkedlist for better performance
- using single byte helper to store message status (ubsubmit/submitted...)
- trigger wake up if messages need to be resubmitted (rejected)
- Slow down when sender credit reaches zero (10ns).
- Add enhanced performance stress test omazureeventhubs-stress.sh
- Add support for static library linking of qpid-proton
  This is needed to build the module from source and remove
  library package dependencies.
- adjusted valgrind suppressions
2023-07-06 23:40:20 +02:00
frikilax
aeaf1160ed NEW CONTRIB::FFAUP:: URL parser module function using libfaup 2021-11-19 09:26:34 +01:00
Rainer Gerhards
1d74aa7064
Merge pull request #4543 from VultureProject/imhiredis_upstream
NEW CONTRIB::IMHIREDIS:: input redis module
2021-04-19 10:18:02 +02:00
Julien Thomas
fad41a6179 fmunflatten: rscript function to unflatten keys in a JSON object
This commit adds a new rainerscript function to unflatten keys
in a JSON tree. It provides a way to expand dot separated fields.

<result> = unflatten(<source-tree>, <key-separator-character>);

It allows for instance to produce this:
    { "source": { "ip": "1.2.3.4", "port": 443 } }

from this source data:
    { "source.ip": "1.2.3.4", "source.port": 443 }

Here is a sample use case:

set $!source.ip = "1.2.3.4";
set $!source.bytes = 3258;
set $!source.geo.country_iso_code = "FR";
set $!destination.ip = "4.3.2.1";

set $.unflatten = unflatten($!, ".");

if (script_error() == 0) then {
    unset $!;
    set $! = $.unflatten;
    unset $.unflatten;
}

{
  "source": {
    "ip": "1.2.3.4",
    "bytes": 3258,
    "geo": {
      "country_iso_code": "FR"
    }
  },
  "destination": {
    "ip": "4.3.2.1"
  }
}

This patch should address (as a post-processing workaround) the needs
expressed in rsyslog/liblognorm#105: permit specifying a multi-level
name. I believe this is somehow what @rgerhards suggested in a comment
on the issue.

The patch was originally written to address a lack of functionality in
Elasticsearch ingest pipeline processors. Some processors would not
accept dotted fields as input (or output, can't remember exactly, at
least in 7.8.1). The dot expander processor can be used to unflatten
fields but this is not generic (and thus, difficult to maintain) as
you have to apply the processor on a known list of fields.
2021-03-28 13:10:02 +02:00
Jérémie Jourdin
5823abf0f8 NEW CONTRIB::IMHIREDIS:: input redis module 2021-02-23 19:06:44 +01:00
Nelson Yen
6102f6083c initial implemenation http input module
- uses http library to provide http input.
user would need to configure an 'endpoint' as input, along
with a ruleset, defining how the input should be routed in
rsyslog.

bugfix, free dynamic buf if created, don't echo to client data.

do data framing using newline character.
more input options support:
  - input name
  - flowcontrol

add support for gzip content support, and other options

- gzip content
- parse linefeeds by default, option to ignore linefeeds

add support for gzip content support, and other options

- gzip content
- parse linefeeds by default, option to ignore linefeeds

WIP - misc edits enable port, documentroot module parameter

fix overloaded stack issue

update tests to use available port instead of hard-coded one.

Add 'octet counted framing' support

- option is "SupportOctetCountedFraming", currently 'off' by
default.

update imhttp-getrequest-file.sh test to use $srcdir

imhttp - support multi-threaded connection contexts.

- tests for large data posts

- Add header data as metadata option

move mg_start into activatecnf instead of in runinput
2020-08-23 07:24:48 -07:00
Rainer Gerhards
cfd07503ba
remove rsyslog.service[.in] sample file
This file is a systemd unit file. Over the past months, we
received numerous complaints from the RH'ish community because
of the "wrong" content of this file. Thus, we changed it to
silence these complaints. Now, very similar complains come
from the Debian'ish community
(https://github.com/rsyslog/rsyslog/pull/4317#discussion_r445907950).

The root cause of these problems is that this is not really
a ryslog-related file. It is a systemd unit file, and obviously
very highly depending on distro policies. It was an excellent
idea to add this file back in the early days of systemd when
nobody knew about unit files. Nowadays, however, a single
"proposed" unit file causes more trouble than it solves.

As such, we will remove the file in rsyslog's project root.
Instead, we will provide distro-specific sample files in the
./platform subdirectory.

This way each distro can maintain its (considerably different)
rsyslog.service without the rsyslog interfering with it.

closes https://github.com/rsyslog/rsyslog/issues/4333
2020-08-11 15:51:34 +02:00
frikilax
76318ad926 NEW INPUT MODULE:: impcap, network packets input parser + TESTS 2020-06-05 17:41:01 +02:00
Rainer Gerhards
7c2eaa8f2e
build system: change --enable-imfile-tests default to "yes"
This was accidentally set to "no". Test for imfile should by
default run when imfile is enabled.

We also temporarily disable the failing tests - this makes
it posible to run the remaining tests during CI and prevent
future errors. That is better than nothing. Tests are to be
re-enabled when the imfile bug mentioned below is fixed.

see also https://github.com/rsyslog/rsyslog/issues/4120

Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2020-01-30 09:36:35 +01:00
Rainer Gerhards
ac95688fd5
build system: add option --enable-gnutls-tests
This enables us to build GNUtls support but not necessarily
test it in CI. This is useful for some specialised subcomponent
test.
2020-01-26 16:28:18 +01:00
Rainer Gerhards
58dfe006a8
testbench: improve tests
modernize them, reduce robustness against slow machines, provide some
test framework functional enhancements and optimizie some tests
2020-01-19 16:09:44 +01:00
fd6c32c2f2 testbench: Add two real tests for omsnmp
Adds a python based SNMP Trap Receiver which outputs received
SNMP Traps by UDP onyl at the moment. Can be extended later.
Tests results are verified by content_check.

The tests have to be enabed with ./configure --enable-snmp-tests

Test sndrcv_omsnmpv1_udp_dynsource.sh checks the new snmpv1dynsource
option.

In order to work, the following python packages needs to be installed:
	pip install pysnmp

On Ubuntu 18, we need these packages to be installed:
	apt install snmp libsnmp-dev snmp-mibs-downloader

closes: https://github.com/rsyslog/rsyslog/issues/3985
2019-12-03 13:26:36 +01:00
major
43d7365f20 mmdarwin: add new module
This is a contributed module.
2019-07-24 13:30:09 +02:00
Rich Megginson
7c46fc0112 omamqp1 - port to latest api, add tests
This brings omamqp1 up-to-date with the latest qpid-proton-c
api version.  This also adds a test for the plugin, to test
the basic functionality.  The test requires the user to
install qdrouterd and the python qpid-proton library in order
to use the simple_recv.py test program.
2019-06-11 08:04:17 -06:00
Rainer Gerhards
92f81d0c71
Merge pull request #3690 from rgerhards/i3684
testbench: some modules were excluded in "make distcheck"
2019-06-05 09:16:54 +02:00
Rainer Gerhards
640514875e
testbench: some modules were excluded in "make distcheck"
see also https://github.com/rsyslog/rsyslog/issues/3684
2019-06-04 10:47:31 +02:00
Rich Megginson
3d9773817e add missing dist files; add mmkubernetes to distcheck 2019-06-03 14:15:43 -06:00
Rainer Gerhards
fcb83fb247
Merge pull request #3476 from pduveau/omrabbitmq_featured
Featuring omrabbitmq
2019-04-09 12:53:43 +02:00
Rainer Gerhards
c1c140cd07
Merge pull request #3591 from pduveau/improg_tests
improg : tests and memory leak patch
2019-04-09 12:29:26 +02:00
Philippe Duveau
3f673be483 improg : tests (traces) + patch + distcheck 2019-04-08 20:33:40 +02:00
Philippe Duveau
b2600c2aa6 Featuring omrabbitmq + tests + LGTM alert 2019-04-08 12:11:33 +02:00
Rainer Gerhards
e6a8510391 build system bugfix: omhttp was ignored during "make distcheck"
see also https://github.com/rsyslog/rsyslog/pull/3598
2019-04-08 11:04:01 +02:00
Philippe Duveau
969c337ac0 Create contrib pmdb2diag + alignment for clang + test 2019-04-04 04:12:36 +02:00
Nelson Yen
82142c7c73 imdocker input plugin - enables pulling container logs from docker
- plugin will get (docker) container logs from a host as well as filling out some
    basic container metadata as id, name, image, labels.
  - requirements: curl-7.40.0+, for unix_domain_socket option (Docker API listens on a
    local socket). Additionally, plugin will handle the issue of log lines larger than
    16KB begin split by Docker.
  - include imdocker-unittests in testbench
  - enable imdocker tests in osx travis tests
  - use curl master branch for imdocker-tests
  - fix cflags for pthread
  - enforce minimum curl version during configuration - to 7.40.0 for imdocker
  - container polls after the initial one are automatically filtered utilizing the 'since' option as per docker api
  - imdocker tests refactored.
  - add escapeLF config option

Test bench test added:
  - imdocker-basic: checks for completeness.
  - imdocker-basic-vg: same as basic with valgrind enabled.
  - imdocker-long-logline: checks imdocker can handle 16K+ log lines.
  - imdocker-long-logline-vg: same as long-logline test with valgrind enabled.
  - add option 'retrieveNewLogsFromStart' which will cause imdocker to ignore the 'tail'
  option when retrieving container logs for newly activated containers. Containers that
  were already active when imdocker first starts still uses the tail option.
  - imdocker-new-logs-from-start: checks that new containers will ignore the tail option
  - imdocker-new-logs-from-start-vg: valgrind enabled
  - multi-line support via docker label: imdocker.startregex
  added multi-line tests for testbench

Travis test bench related history and notes:
 - Travis tests, enable imdocker
 - imdocker travis tests not enabled in precise or trusty ubuntu versions of travis-test.
   Assuming travis tests will run in ubuntu 16
 - tests: harden container name against strange file system pathes
   RSYSLOG_DYNNAME contains the file system path, which is NOT guarnateed
   to be suitable for things other than file names.
 - tests: bugfix and guard against false negative
 - content_check_with count was done before rsyslog was terminated, so
   it was uncertain how many messages were written at that spot
   (especially on slow machines)
 - so far, only the number of lines was checked, not their content. So
   any problems with the actual messages would not have been detected.
 - improved support for listcontainer options, fix racy imdocker tests
2019-04-02 08:29:05 +02:00
Rainer Gerhards
23af460e5f
Merge remote-tracking branch 'pduveau/contrib_imbatchreport' 2019-04-01 10:42:32 +02:00
Philippe Duveau
ff384385d1 Create module mmtaghostname with tests 2019-03-30 16:51:06 +01:00
Philippe Duveau
dff0e393f6 Create imbatchreport input module + parallel tests 2019-03-30 16:40:32 +01:00
Philippe Duveau
9b1cc52152 contrib_imtuxedoulog + tests 2019-03-10 13:27:51 +01:00
Rainer Gerhards
e66bd10fe5
improg: add new module 2019-03-04 10:23:04 +01:00
Rainer Gerhards
e1885bc805
imzmq3/omzmq3: remove modules
according to @brianknox these modules are outdated:

https://twitter.com/taotetek/status/931860786959540224

They are replaced by imczmq/omczmq and are no longer maintained. We put a
deprication notice into the modules a year ago, and now it finally is time
to remove them. They do NOT build in any case, except if very old versions
of the 0mq ecosystem are used.

see also https://github.com/rsyslog/rsyslog/issues/2100
closes https://github.com/rsyslog/rsyslog/issues/2103
2019-01-10 10:59:30 +01:00
PascalWithopf
687f5c1ee1 new output module for clickhouse
This output module adds the posibility to send
INSERT querys to a Clickhouse database.
The messages are sent via a REST interface.

This commit also adds support of the testbench
for clickhouse tests, as well as  various tests.

Closes https://github.com/rsyslog/rsyslog/issues/2272
2018-12-20 10:49:45 +01:00
Rainer Gerhards
22e297dc51
make distcheck did not honor "--enable-mysql-tests"
see also https://github.com/rsyslog/rsyslog/issues/3223
2018-10-31 18:35:03 +01:00
Rainer Gerhards
841c24a00e
bugfix build system: --enable-journal-tests option not in distcheck
this option was not passed down to "make distcheck" and so journal tests
were never executed in distcheck runs
2018-10-28 12:29:12 +01:00
Christian Tramnitz
73ca164715 add contrib module omhttp
closes https://github.com/rsyslog/rsyslog/issues/1797
replaces https://github.com/rsyslog/rsyslog/pull/2782
2018-09-06 10:00:47 +02:00
Rainer Gerhards
5e1bfa5f91
travis: reduce runtime on "distcheck" commit
We run only some distcheck test that we cannot yet run inside
the containers on travis. This reduces the amount of redundant
work done, speeding up Travis runtime.

Any missing checks are still detected by buildbot part of CI.
2018-07-28 13:00:08 +02:00
Rainer Gerhards
e27b59634c enable better testing via "make distcheck"
Also a couple of changes to testbench worth mentioning:
* use cp -f to ensure files can be overwirtten in VBUILD
* fix issue of missing include test file in EXTRA_DIST
* new supressions
* testbench: try to use local system dependency cache
  avoid going to Internet repos if not absolutely necessary. For
  development containers, they should be pre-populated with the
  important dependencies.
* do not enable libfaketime if ASAN is selected
  unfortunately, libfaketime does not work in that case

see also https://github.com/rsyslog/rsyslog/issues/174
2018-07-11 15:01:55 +02:00
Rainer Gerhards
3a25ed68ae
cleanup: remove no longer needed --enable-memcheck
veeeeery old testing capability, no longer functional but
causes build to fail if enabled. Replaced by ASAN/valgrind.

Issue detected while testing some other CI settings.
2018-06-27 10:29:48 +02:00
Rainer Gerhards
26d3fd0ef9
Merge pull request #2465 from CodeHarsh/master
adding hash64 and hash64mod functions support in rainerscript
2018-04-17 15:29:09 +02:00
Rainer Gerhards
9348d2b3af create contrib module omfile-hardened
This is in preparation for Mikko Kortelainen's experiemental contribution.

see also https://github.com/rsyslog/rsyslog/pull/2490#issuecomment-377545898
2018-04-02 11:20:56 +02:00
Harshvardhan Shrivastava
915fe6935b moving fmhash to contrib and removing ignore-strict-prototypes 2018-03-30 00:09:54 +05:30
Tomas Heinrich
77886e2129 WIP - Add the mmkubernetes plugin
DO NOT MERGE - This is a work-in-progress.
2018-03-28 15:46:54 -04:00
Harshvardhan Shrivastava
006ba9c5b1 making hashXX function module 2018-03-28 19:13:17 +05:30
Jan Gerhards
22fc00e897 rscript: make function modules loadable
function modules add functions to rainerscript dynamically,
change http_request into such a module (enabled by default).
This module can be used as a sample for future function modules.
2018-03-19 11:49:36 +01:00
PascalWithopf
d4cc699129 pmnormalize: add new parser module pmnormalize 2017-07-19 08:58:20 +02:00
Rainer Gerhards
aecdbdf360 mmdblookup: upgrade from contrib module to fully supported one 2017-05-31 13:43:05 +02:00