1195 Commits

Author SHA1 Message Date
Rainer Gerhards
26ee7dc527
testbench: migrate testbench run to ElasticSearch 7
ElasticSearch 7 is now the major version. Replacing old-style
ES with it by default.

also add basic test for ElasticSearch 7.14, to make sure we will
test ES 7 once we move up to next higher version.

Note: ES 5 is no longer beeing tested as it looks outphased.

see also: https://github.com/rsyslog/rsyslog/pull/4566
2021-09-14 09:59:12 +02:00
Nelson Yen
a8b8d6c1f9
imhttp updates - query parameter ingestion & basic auth support
- Basic Authentication support & tests
  * configured via imhttp option "basicAuthFile". This option should be configured
    to point to your htpasswd file generated via a standard htpasswd tool.
  tests:
  * imhttp-post-payload-basic-auth.sh
  * imhttp-post-payload-basic-auth-vg.sh

- Query parameter ingestion capability & tests
  use t `addmetadata` option to inject query parameters into
  metadata for imhttp input.

Signed-off-by: Nelson Yen <nyen@salesforce.com>
2021-09-10 08:38:20 -07:00
9a1f4c0f59 testbench: add testcase for queue discardSeverity (linkedlist)
Testcase omfwd_fast_imuxsock.sh uses imuxsock as input and checks
how the queue engine (linkedlist) handles discarded messages.

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

requires PR:
https://github.com/rsyslog/rsyslog/pull/4674
2021-09-09 11:29:54 +02:00
Petr Gajdůšek
d69420a6a1 ratelimit: fix rate limiting for already parsed messages
Rate limiting may not have worked if the considered message had already
been parsed (not having NEEDS_PARSING in msgFlags).

This affects also imuxsock in its default configuration
(useSpecialParser="true" and ratelimit.severity="1")

A test for imuxsock is included which requires
./configure --enable-liblogging-stdlog
2021-08-25 17:33:17 +02:00
Rainer Gerhards
6080121ab7
config: implement script-equavalent for $PrivDrop* statements
closes https://github.com/rsyslog/rsyslog/issues/891
2021-08-23 14:10:16 +02:00
Rainer Gerhards
0c9b169a64
Merge pull request #4612 from n2yen/dev2-percentile
Percentile module to track percentile metrics via impstats
2021-08-16 08:31:21 +02:00
Rainer Gerhards
0461bacd4f
Merge pull request #4626 from n2yen/dev-ignore-older
imfile add `ignoreolderthanoption`
2021-08-12 10:18:25 +02:00
Nelson Yen
db44a20a25
imfile add ignoreolderthanoption
Submit on behalf of the primary author @yanjunli76

instructs imfile not to ingest a file that has not been modified in the
specified number of seconds.
2021-08-11 08:11:55 -07:00
Rainer Gerhards
a25c01c3d2
Merge pull request #4633 from pearseimperva/pearse/fix-deleteStateOnFileDelete
Fixing the deleteStateOnFileDelete option
2021-08-09 18:52:42 +02:00
Rainer Gerhards
38856e6989
Merge pull request #4628 from rgerhards/ci-add-test
CI: add test for imtcp not correctly starting up
2021-08-09 09:29:34 +02:00
pearse
fca8e14d65 fixing the deleteStateOnFileDelete option 2021-08-06 22:25:27 +00:00
Rainer Gerhards
be22ec54ad
CI: add test for imtcp not correctly starting up and a Solaris fix
Test should have been added to commit 3d23c7ac8aea but was forgotten.

This test also showed an issue on Solaris, where NULL values cannot
be used in printf functions. This has also been addressed.

see also: https://github.com/rsyslog/rsyslog/pull/4627
2021-08-06 12:42:58 +02:00
Rainer Gerhards
39e81e133b
omfwd: add capability for action-specific TLS certificate settings
This permits to override the global definitions for TLS certificates
at the action() level.
2021-08-06 09:00:24 +02:00
Rainer Gerhards
13f5dfe2e2
imtcp: permit to use different certificate files per input/action 2021-08-04 10:23:24 +02:00
Rainer Gerhards
b78fdde38a
Merge pull request #4407 from alorbach/pr-issue-4406
testbench: Add testcase for librelp EINPROGRESS issue
2021-06-23 09:36:50 +02:00
Nelson Yen
91a2049877
percentile module to track percentile metrics via impstats
Brief overview:
TO configure tracking percentile metrics in rainerscript:
User would need to define:
  - which percentile to track, such as [p50, p99, etc.]
  - window size - note, this correlates directly with memory usage to
  track the percentiles.

To track a value, user would call built-in function `percentile_observe()` in their configurations to
record an integer value, and percentile metrics would be emitted every
impstats interval.
2021-06-23 00:14:39 -07:00
bda68f999d omhttp: Fix dynrestpath param in batch mode
When batchmode was used, the templates could not be used to
expand dynrestpath. We are now storing the restpath param
within the batch data if we are in batch mode.

- testbench: Added tests for omhttp dynrestpath param
  Testing setting the restpath by template - one with batch mode
  and one without batch mode
- When we are in batch mode, and the restpath value changes, the
  batch is submitted and reinitialized

closes: https://github.com/rsyslog/rsyslog/issues/4567
2021-06-16 11:43:08 +02:00
6e2a79376f testbench: Add testcase for librelp EINPROGRESS issue
closes: https://github.com/rsyslog/rsyslog/issues/4406
See also: https://github.com/rsyslog/librelp/issues/207
2021-06-16 09:40:29 +02:00
Rainer Gerhards
8d48ecf10a
imtcp: add more override config params to input() 2021-05-10 12:30:17 +02:00
Rainer Gerhards
a08591be5d
imtcp: add stream driver parameter to input() configuration
This permits to have different inputs use different stream drivers
and stream driver parameters.

closes https://github.com/rsyslog/rsyslog/issues/3727
2021-05-05 12:57:09 +02:00
Rainer Gerhards
39896ca622
config script: add re_match_i() and re_extract_i() functions
This provides case-insensitive regex functionality.

closes https://github.com/rsyslog/rsyslog/issues/4429
2021-04-21 12:23:46 +02:00
Nelson Yen
af8085fc83
Add built-in function get_property() to access property vars
Provides ability to evaluate a rsyslog variable using dynamically
evaluated parameters.
  1st param is the rsyslog param, 2nd param is a key, can be an array
  index or key string.

Useful for accessing json sub-objects, where a key
needs to be evaluated at runtime. Can be used to access arrays as well.

see tests for examples

remove unnecessary escape char
2021-04-15 11:52:15 -07:00
Rainer Gerhards
2381890467
Merge pull request #4551 from julthomas/dev/jth/fmunflatten
fmunflatten: rscript function to unflatten keys in a JSON object
2021-04-06 19:14:23 +02:00
Rainer Gerhards
14aabc691e
testbench: add check for proper config include file order
This commit adds a check that include files are processed in the
proper order.

It also slightly changes some text that seemed to cause the wrong
impression that include files were processed in the wrong order.
Right the contrary is the case, as config files are being put on
a stack before they are processed.

closes https://github.com/rsyslog/rsyslog/issues/4271
2021-03-29 10:24:53 +02:00
Julien Thomas
9b779a319e tests: add test case for rscript function unflatten
You may want to review some of these tests.

The "conflict" and "key truncated" test cases are checking for a debug
message (rsyslog debug), this may be overkill. Also some tests require
jq in $PATH, to get deterministic JSON output (sorted keys). If jq is
not found, the tests are skipped.
2021-03-28 13:10:02 +02:00
Rainer Gerhards
591e6b1f0f
omfwd: add stats counter for sent bytes
Thanks to John Chivian for suggesting this feature.
2021-02-15 10:54:09 +01:00
Rainer Gerhards
17d66bebfb testbench: fix invalid sequence of kafka tests runs
kafka tests can not run well in parallel (mostly due to ressource
constraints on CI machines). Accidentally, this was not enforced for
one of the tests. That could lead to random failures and false positives.
2021-01-15 12:23:31 +01:00
Rainer Gerhards
78b4428270
Merge pull request #4476 from rgerhards/i4446
testbench: fix missing test file
2020-12-07 13:52:39 +01:00
Rainer Gerhards
2ed8a931eb
testbench bugfix: some tests did not work in make distcheck
- certificate file missing in dist tarball
- some test cases did not properly specify path to cert file
- also bumping some zookeeper component versions

Thanks to Michael Biebl for alerting us and providing part of
the fix.

closes https://github.com/rsyslog/rsyslog/issues/4446
2020-12-07 12:34:59 +01:00
Rainer Gerhards
3238729d96
immark: rewrite with many improvements
- mark message text can now be specified
- support for rulesets
- support for using syslog API vs. regular internal interface
- support for output template system
- ability to specify is mark message flag can be set
- minor changes and improvements
2020-12-07 09:45:24 +01:00
Rainer Gerhards
1c85aa8a59
add new system property $now-unixtimestamp
Among others, this may be used as a monotonic counter
for doing load-balancing and other things.

Thanks to Nicholas Brown for suggesting this feature.
2020-11-04 13:02:22 +01:00
b5356f8db7 tls: Allow calling PermitExpiredCerts with NULL parameter
In order to set the default PermitExpiredCerts handling (Denied),
we need to call PermitExpiredCerts with NULL parameter.

testbench: Add test to check expired handling in omfwd

debug: Fix dbgprintf calls with possible NULL character parameters

closes: https://github.com/rsyslog/rsyslog/issues/4425
2020-10-28 09:18:25 +01:00
Rainer Gerhards
d247c31888
add 'exists()' script function to check if variable exists
This implements a way to check if rsyslog variables (e.g. '$!path!var') is
currently set of not.

Sample: if exists($!somevar) then ...

closes https://github.com/rsyslog/rsyslog/issues/4385
2020-10-05 12:38:58 +02:00
Rainer Gerhards
500713dbde
Merge pull request #4301 from n2yen/imhttp
http input module
2020-09-14 08:22:33 +02:00
Rainer Gerhards
6e810d3f5e
CI: run testbench on ubuntu 20 with github action 2020-09-07 11:21:30 +02:00
Rainer Gerhards
d23e73c782
Merge pull request #4394 from rgerhards/i4282
Queue: add test for segfault issue 4282
2020-09-02 10:15:06 +02:00
Rainer Gerhards
6763185783
core bugfix: segfault if disk-queue file cannot be created
When using Disk Queue and a queue.filename that can not be created
by rsyslog, the service does not switch to another queue type as
supposed to and crashes at a later step.

closes: https://github.com/rsyslog/rsyslog/issues/4282
2020-09-02 09:20:10 +02:00
9513b7aa40 testbench: Add helpertool to check for minimum librelp version
- add testcases for imrelp / omrelp chained certificates
  for new librelp version 1.7.0
- add chained certificate based on existing certs

closes: https://github.com/rsyslog/rsyslog/issues/4388
2020-08-31 11:39:25 +02: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
Alfred Perlstein
6c50426dbf Add max sessions for imptcp.c similar to imtcp.c
The max is per-instance, not global across all instances.

There is also a bugfix where if epoll failed I think we could leave a
session linked in the list of sessions, this code unlinks it.
2020-08-11 19:06:37 -07:00
6d0fea9b69 openssl: Fixed memory leak when tls handshake failed.
Added testcase for ossl memory leak on failed handshake.

closes: https://github.com/rsyslog/rsyslog/issues/4319
2020-06-09 10:01:53 +02:00
Rainer Gerhards
d3f3cf54b4
testbench: add test case for cat non-existing-file
see also https://github.com/rsyslog/rsyslog/issues/4290
2020-05-22 10:13:30 +02:00
82621cdd14 imtcp: fix octet framing/stuffing problem with discardTruncatedMsg on
When "discardTruncatedMsg" is enabled in imtcp, messages were incorrectly
skipped if the last character before the truncation was the LFdelimiter.

Add two tests for octet stuffing and framing.

closes: https://github.com/rsyslog/rsyslog/issues/4281
2020-05-15 09:56:44 +02:00
Rainer Gerhards
6aed1b4975
Merge pull request #4219 from callmegar/master
omhttp: Adding multiple http headers capability
2020-05-11 12:12:55 +02:00
Rainer Gerhards
589eac07b2
Merge pull request #4240 from alorbach/pr-issue-4005
testbench: Add test for imrelp to check broken session handling.
2020-04-29 12:03:16 +02:00
Rainer Gerhards
67934f1feb
Merge pull request #4254 from alorbach/pr-issue-4238
omudpspoof: Fixed issues with oversized messages (Exceeding the configured MTU setting).
2020-04-29 11:42:50 +02:00
e2a9e3da2d omudpspoof: Added test for oversized UDP messages (above 1500 MTU) 2020-04-27 11:13:24 +02:00
baee0bd542 testbench: Add test for imrelp to check broken session handling.
For successfull test, the PR
https://github.com/rsyslog/librelp/pull/184
 for Issue
https://github.com/rsyslog/librelp/issues/183
is needed. Otherwise the test will trigger a double free inside
librelp which results in a segfault in some cases.

closes: https://github.com/rsyslog/rsyslog/issues/4184
closes: https://github.com/rsyslog/rsyslog/issues/4005
2020-04-27 10:55:50 +02:00
b84c9debea stream.c: Moved doSizeLimitProcessing check to strmWrite
The check was done in strmPhysWrite before which caused syslog
messages to split in the middle if the syslog message batch exceeded
the default IO Buffer size.

closes: https://github.com/rsyslog/rsyslog/issues/4233
2020-03-31 17:27:01 +02:00
Rodriguez,German J
95e830cc22
omhttp: Adding multiple http headers capability 2020-03-17 20:12:10 -05:00