1210 Commits

Author SHA1 Message Date
Rainer Gerhards
024e424de9
testbench: remove es 6.0 based tests
EleasticSearch 6 is heavily outdated. Testing against that
platform is no longer needed.
2025-01-27 09:46:49 +01:00
Rainer Gerhards
eff1a63b73
testbench: add new and adapt imtcp tests for large connection counts
Updated the imtcp test suite to set the "SocketBacklog" parameter to a higher
value to accommodate tests with a large number of concurrent connections.
This change addresses potential CI flakes caused by SYN queue overflows during
test runs and significantly reduces test runtime by avoiding delays during
session setup.

The adjusted SocketBacklog parameter ensures smoother handling of high
connection counts, improving test reliability and performance.
2025-01-23 17:02:00 +01:00
Rainer Gerhards
590d5e22ce
testbench bugfix: typo caused invalid test file to be used
... which went unnoticed during regular make check runs, but lead to
"left-over files after distclean" after make distcheck.

This could also potentially be responsible for some flakes that were
not fully explainable.
2024-11-13 14:16:42 +01:00
Rainer Gerhards
5cb26b544c
build system: correct invalid file name
This could cause hang during "make dist"
2024-08-19 15:21:40 +02:00
Rainer Gerhards
1c0f9bba50
omfwd: implement native load balancing - phase 1
This patch implements a simple round-robin load balancer
for omfwd. It provides equal distribution of load to a pool
of target servers.

The code currently has no different modes and no special tuning
for the load balancer. However, it works very well in the most
common use cases. Furthermore, it provides a solid base on which
more elaborate functionality can be build if there is need to.

The new functionality is fully backwards compatible with previous
configuration settings.

New action() config params:
* pool.resumeinterval

New/"changed" rstats counters
Each target receives its own set of pstats counters. Most
importantly this is the case for byte counts. That counter retains
the same naming, but there may now be multiple of these counters,
one for each target ip, port tuple.

New pstats message count to target
Among others, this can be used for checking that the load balancer
works as intended. The so-far byte count emitted does not provide
a clear indication of how many messages the targets had actually
processed.

For obvious reasons, this message count makes most sense in
advanced load balancing scenarios, but also provides additional
insight into round-robin. Non-matches indicate that targets
went offline, and we can now evaluate the impact this had
on processing.

- re-design rebind functionality

This now works at the transaction level. It causes a rebind of all
pool members. Previous code did not work 100% correct since for a
couple of years now (after output batching integration).

As cleanup, rebindInterval support has been removed from tcpClt,
because omfwd is the only user. This permits a cleaner code path.

We also noticed a bug with rebindInterval:  it caused some mild
message duplication for quite some time. This went unnoticed.
To address that efficiently, rebindInterval in the future will
be considered once per batch. That means up to (maxBatchSize - 1)
messages may be transmitted more than the rebindinterval is.
That's the cleanest mode of operation and should not make any
difference for real deployments.

Some additional work done in this commit:

netstream: harden component against upper-layer logic errors

network subsystem: better handle API errors and provide more info

omfwd: add new parameter "iobuffer.maxsize"

add new global parameter debug.abortoninternalerror and use it

This parameter permits to make test runs fail when an internal error
is detected and gracefully handled by rsyslog. While it is great to
have it gracefully handled in practice, we should not accept this
during testing. The new parameter permits to abort in this case and
emits the related error message beforehand. It is turned on by
default in our regular tests.

add dedicated error code for "hard" program errors

omfwd: some cleanup + error message fix + new debug level messages

imptcp: improve error messages

add omfwd option to NOT do extended connection check

also output wrkr id in some omfwd messages (primarily debugging aid)

better debug info via LogMsg() interface

improve messages regarding imptcp and omfwd suspension / thread IDs

refactor and enchance minitcpsrvr for mimicing died servers

new global (debugging) option, correction of an informational msg

add global option allmessagestostderr

add new tests
2024-08-19 08:54:31 +02:00
bf60befc54 omazureeventhubs: Fix implementation of amqp_address parameter
Parameter amqp_address is now handeled correctly. Added testcase for
amqp_address parameter.

closes: https://github.com/rsyslog/rsyslog/issues/5413
2024-07-22 12:13:59 +02:00
6c3795ea75 openssl: evp support and custom openssl engine support
- output all loaded ciphers and engines.
- Add new global option "defaultopensslengine" to customize the
  default openssl engine. If not defined, openssl will handle the
  default engine automatically.
- Add simple openssl performance test with defaultopensslengine
  set to rdrand (Intel).
- removed unneeded testcase files in runtime folder.
- corrected whitelist settings for debug.files in TLS testcases
2024-05-02 12:07:14 +02:00
86dcac1459 testbench: Update zookeeper bin download to 3.9.2
3.9.1 can no longer be downloaded, see for latest version:
https://downloads.apache.org/zookeeper/

Added missing testcases for distcheck, see commit:
a67af36914
2024-04-09 11:42:53 +02:00
Rainer Gerhards
8d384b9f89
Merge pull request #5302 from n2yen/dev-omhttp-patches
omhttp patches and updates
2024-04-02 11:55:27 +02:00
Rainer Gerhards
39fce095f3
testbench bugfix: testbench tarball did not include a test script
Thanks to Michael Biebl for alerting us.

closes https://github.com/rsyslog/rsyslog/issues/5337
2024-02-27 17:20:24 +01:00
Rainer Gerhards
f2f9332f07
Merge pull request #5280 from alorbach/pr-issue-5211
Initial implementation of imdtls and omdtls modules
2024-02-26 09:15:25 +01: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
Nelson Yen
a67af36914
WIP - omhttp patches and updates 2023-12-30 19:38:25 -08:00
Rainer Gerhards
1f864ec519
testbench: make omusrmsg-noabort test more reliable
The previous test did not always detect an abort of rsyslog/omusrmsg.
The detection method has now been improved, so it is far more
probable that an abort is detected.

While doing this, we noticed that the omusrmsg-noabort-legacy test was
now a 100% duplicate. There is no need any longer to check pure legacy
syntax, and so that test has been removed.

We also added a valgrind-based test ofr omusrmsg-noabort, which furthers
strengthens bug detection. Most importantly, it helps us to detect
potentially new memory leaks on all CI platforms (in case the lib
behaves differently depending on os/distro).

see also https://github.com/rsyslog/rsyslog/issues/5294
2023-12-14 14:43:23 +01:00
193fc7bc34 omazureeventhubs: Corrected handling of transport closed failures
- Added test for connection interrupts (requires root)
- Corrected handling of PN_TRANSPORT_CLOSED.
- Make sure Connection is being reestablished trough tryResume
- Enhanced Debug log output

closes: https://github.com/rsyslog/rsyslog/issues/5269
2023-11-09 14:19:03 +01:00
Rainer Gerhards
de5069c26c
TLS subsystem: add remote hostname to error reporting
This provides richer and easier to process logs for error and warning
cases. One goal is to enable automatic operations without the need
to consolidate multiple message to a single information.

This improves one situation in gtls driver and provides a more
generic approach in ossl driver for OpenSSL error reporting.

There is probably still room for improvement, however this patch
is at least a good starting point for further work. Please
provide feedback if you need more!

closes https://github.com/rsyslog/rsyslog/issues/5244
2023-10-25 16:00:03 +02:00
Rainer Gerhards
b6b4f25eda
lookup tables bugfix: reload on HUP did not work when backgrounded
Lookup tables were only reloaded on HUP if the -n option was given
and rsyslog no backgrounded. This patch fixes the issue.

closes: https://github.com/rsyslog/rsyslog/issues/4813
2023-08-02 15:01:31 +02:00
Rainer Gerhards
8f6845e000
Merge pull request #5175 from darrenmoffat/master
TLS CRL Support Issue 5081
2023-07-07 13:21:44 +02:00
6c83bffb6a PR5175: Add TLS CRL Support for GnuTLS driver and OpenSSL 1.0.2+
- Add TLS CRL support tp GnuTLS driver using gnutls_certificate_set_x509_crl_file.
- Add code in OpenSSL driver that works with OpenSSL 1.0.2 and higher.
  Disable feature on older features with error message.
- Some cosmetic changes
- testbench: Add revoked certificate for testing (Including CRL PEM and other files)
- testbench: Add testcase for gtls and ossl testing revoked certificates
2023-07-07 08:02:05 +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
Rainer Gerhards
fa83b5b4bd
Merge pull request #5143 from VultureProject/redis_streams
New Redis streams functionality + various fixes and improvements
2023-06-19 10:22:00 +02:00
Rainer Gerhards
e1ad71da39
Merge pull request #5012 from sakateka/fix-external-dir-fd-leaking
imfile: Fix leak of fd of external directories
2023-06-06 15:00:28 +02:00
frikilax
ca4e320c3a OMHIREDIS::ADDED:: New support for 'stream' mode
### ADDED
- [OMHIREDIS] module is now able to insert entries to a Redis Stream
- [OMHIREDIS] in 'stream' mode, module can insert the message to a custom field in the entry ('msg' by default)
- [OMHIREDIS] in 'stream' mode, module can acknowledge an entry coming from imhiredis (if entry was claimed but not ACK'ed)
- [OMHIREDIS] in 'stream' mode, acknowledgements can be made from dynamic templates or static values
- [OMHIREDIS] in 'stream' mode, module can approximately cap the size of the output stream
- [OMHIREDIS] in 'stream' mode, module can delete an entry while inserting its message (useful to remove entry coming from another stream with imhiredis)
- [OMHIREDIS] new tests for 'stream' mode
 ### FIXED
- [CONFIGURE.AC] Missing line to give omhiredis compilation status
2023-05-23 11:01:03 +02:00
frikilax
4fa296727c OMHIREDIS::ADDED:: new tests for existing functionalities 2023-05-23 11:01:03 +02:00
frikilax
3ac9fa5267 IMHIREDIS::ADDED:: New support for 'stream' mode
- [IMHIREDIS] Add support for simple XREADs from Redis Streams (Redis >= 5.0 required)
- [IMHIREDIS] Add support for XREADGROUP from Redis Streams, allowing for user to define workers to dequeue logs in a stream
- [IMHIREDIS] stream mode can select fields to extract and insert in custom keys
- [IMHIREDIS] Add tests for the new 'stream' modes
2023-05-23 10:58:40 +02:00
frikilax
4ef42fde7a REDIS::ADDED:: Implement tests for imhiredis module
- changed diag.sh to be able to start/stop/clean a redis server
- added helper functions in diag.sh to be able to query a redis server instance
- added new tests for imhiredis module to check
  - that the queue mode works, with both lpop and rpop
  - that the module is capable of handling a redis server going down
  - that the module is capable of handling a redis server that appears afterwards
  - that the subscribe mode works
2023-05-17 12:02:22 +02:00
Rainer Gerhards
7245abb709
core/template: implement negative position.to
This will easily permit to drop the last n characters from a property
without the need to know the exact length of the string. This is
especially useful as the exact length is most often not known
beforehand.
2023-01-20 10:47:22 +01:00
Rainer Gerhards
8d4b115f64
Merge pull request #5065 from rgerhards/substring-enhance
substring function: enhancement and hardening
2023-01-16 14:59:28 +01:00
Rainer Gerhards
1e7abb8a1a
substring function: enhancement and hardening
Now, length can have a negative value -n to denote that the
substring should be build between startpos and the character
-n chars from the end. This is a shortcut for stripping charactes
on "both ends" of the string.

Also, some hardening against invalid startpos and length has
been added.
2023-01-13 13:20:24 +01:00
Rainer Gerhards
f95676d849
omfile: add action parameters "rotation.*"
Add new action parameters
- rotation.sizeLimit
- rotation.sizeLimitCommand
provide automatic output file rotation functionality feature-wise
equivalent to legacy $outchannel. This finally permits to use
this feature set in rscript.
2023-01-11 13:06:15 +01:00
Rainer Gerhards
e6f1866f55
testbench: add test for invalid json template generation
see also: commit 246b8d8553b6880146d6c489a28cf4bacea8a199
see also: https://github.com/rsyslog/rsyslog/pull/5050
see also: https://github.com/rsyslog/rsyslog/pull/5052
2022-12-30 17:57:13 +01:00
Sergey Kacheev
e8ac82e09f imfile tests: ext directory's fd leak in case of inotify on symlink 2022-12-05 12:35:33 +07:00
Rainer Gerhards
d083a2a2c2
Merge pull request #4977 from rgerhards/i4975
core bugfix: correct local host name after config processing
2022-09-07 09:24:55 +02:00
Rainer Gerhards
ba00a9f252
core bugfix: correct local host name after config processing
rsyslog.conf may affect the host's local name. These changes were
so far only activated after the first HUP. This patch now ensures
that the configured local host name is applied correctly throughout
all processing, including early startup.

This patch causes a slight change of behaviour. However, the behaviour
was inconsitent before. Now it is consistent and according to the config.

Please note: this patch also exposes a global entry point via "regular"
dynamic loading as this makes things much easier to do. This is in-line
with ongoing simplification effort.

Finally, we also remove a CI test that we do no longer need because
the problem covered is now addressed differently and the original issue
can no longer occur.

closes https://github.com/rsyslog/rsyslog/issues/4975
2022-09-06 13:01:37 +02:00
0bec49cbe3 testbench: Add more valgrind tests for sndrcv (omrelp/imrelp)
- These tests will help find race conditions hopefully
- fix diag.sh issues running second instance in valgrind mode only
- Add check for minimum valgrind version for new relp tests
2022-09-01 13:59:49 +02:00
Rainer Gerhards
ffd0acc9ca
Merge pull request #4889 from sarroutbi/ca_extra_files
Add mechanism to include extra CA files parameter
2022-08-26 16:20:38 +02:00
Rainer Gerhards
6be9a266ea
testbench: add testcase for frequent imfile input file change
PoC test, yet incomplete

This patch not only contains the new test but also supporting
changes to testbench tooling.

see also: https://github.com/rsyslog/rsyslog/issues/4797
2022-08-04 12:54:07 +02:00
a335ec06f0 mmanon: Simplified and fixed IPv4 digit detection.
- Fixed an issue with numbers above int64 in syntax_ipv4.
  Numbers that were up to 256 above the max of an int64
  could incorrectly be detected as valid ipv4 digit.
- Simplified the IPv4 digit detection function and renamed
  to isPosByte.
- added testcasse for malformed IPvc4 addresses

closes: https://github.com/rsyslog/rsyslog/issues/4940
2022-08-03 14:29:39 +02:00
Rainer Gerhards
90feae08e6
omfile: support for zstd compression
The zstd library provides better and faster compression than zlib.
This patch integrates zstd as a dynamically-loadable functionality.
As such, no further dependencies need to be added to the rsyslog
base package.

Due to the increased performance, usage of zstd is highly recommended
for high-volume use cases.

This patch also refactor zlib compression in order to unify handling
in both compression cases.
2022-07-13 14:31:51 +02:00
Sergio Arroutbi
318449ad3a Add mechanism to include extra CA files parameter
This change allows to include extra CA files
so that no "unable to get issuer certificates" issue
is obtained when using chained cert files.
Proposed new parameter name is "NetstreamDriverCAExtraFiles"

fixes #4851

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2022-07-13 11:12:29 +02:00
Rainer Gerhards
18e3505b62 omelasticsearch: some amendments to contributed patch
We disable ElasticSearch strict security in testbench, as
we do not need it for test runs, and it complicates thing.s
Note: this does NOT introduce a security weakness, because we use
only temporary testing ES instances which are always immediately
discarded after the test AND are run in our own test env with
user permissions.
2022-05-19 13:17:18 +02:00
Rainer Gerhards
b564a13451
testbench bugfix: some valgrind tests were run when valgrind disabled
This leads to test failures e.g. with LLVM sanitizers.
2022-05-09 13:06:59 +02:00
Rainer Gerhards
30ccf7cd4c
testbench: new tests for potential buffer overrun 2022-04-25 10:25:17 +02:00
Rainer Gerhards
88c67d80e4
Merge pull request #4822 from sarroutbi/maxfilesize_non_empty_errorfile
Ensure error file does not increase appropriately when action.errorfile.maxsize option is enabled
2022-04-18 11:02:38 +02:00
Rainer Gerhards
6c16d84237
Merge pull request #4758 from mbarbon/mbarbon/format-iso-week
add property options to support ISO week/year number
2022-04-01 12:57:31 +02:00
Sergio Arroutbi
5734b5853a Ensure errorfile max. size correct handling
When action.errorfile.maxsize configuration
option is enabled and error file already has a
certain size smaller than max size configured,
it is increasing higher than configured max
size as the error file is considered
to be zero in code.
This fix reads current error file size and
limits the size to the maximum size configured

fixes #4821

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2022-04-01 11:17:46 +02:00
Rainer Gerhards
71b81626ef
testbench: add tests for rscript comparison operations 2022-03-31 10:16:27 +02:00
Sergio Arroutbi
f64ef442d5 Add option to limit error file to configured size
action.errorfile.maxsize has been added to enable
option to limit the amount of bytes dumped to
configured errorfile

fixes #4733

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2022-03-03 14:13:25 +01:00
Rainer Gerhards
94b467b3ee
Merge pull request #4690 from rgerhards/es7-test
testbench: restore original order of ES test execution
2022-02-04 17:54:33 +01:00
Rainer Gerhards
1a403f987b
testbench: restore original order of ES test execution
The order of execution was changed to a less optimal (more startups,
thus slower) order to work-around a testbench issue. This has been
fixed and so we can restore the original order.
2022-02-04 16:18:22 +01:00