97 Commits

Author SHA1 Message Date
Rainer Gerhards
3935fc9575
mmjsontransform: add experimental JSON dotted-key (un)flatten
Real-world need: unflatten dotted JSON into nested objects, and optionally
flatten back for downstream tools. This introduces a general transformer
with a dedicated output tree. Interface is intentionally unstable.

Impact: New module behind --enable-mmjsontransform; no default behavior
changes. New tests and docs added. Parameters and behavior may change.

Add mmjsontransform, a message modification module that rewrites dotted
JSON keys. By default it "unflattens" an input object to nested containers
and stores the result in a configured output property. A mode parameter
also supports "flatten" to collapse nested trees into dotted keys. The
action refuses to overwrite an existing destination, validates that input
is a JSON object, and reports conflicts with precise key paths. Per-action
config is immutable; workers hold pointers only, so no extra locking. Docs
(Sphinx + parameter refs) and doxygen coverage included, plus a regression
test exercising nested arrays/objects. Build system and CI scripts gain
--enable-mmjsontransform and a basic test hook. An experimental companion
mmjsonrewrite module is wired similarly for dotted-key expansion.

Before/After: Previously no built-in JSON un/flatten; now an action can
unflatten (default) or flatten JSON into a separate message property.

With the help of AI Agents: ChatGPT codex, gemini
2025-10-03 17:35:36 +02:00
Rainer Gerhards
697f7d8378
CI: many kafkatests were not executed b/c kafkacat was renamed
kafkacat has been renamed to kcat, as it looks for trademark issues.
Kafka module tests depend on that utility and are skipped if command
is not available. This was now always the case for newer development
containers.

Name was now adjusted in all tests.
2025-09-04 17:18:42 +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
Rainer Gerhards
e7541dcd0f
new default development container and update Travis to new compilers 2019-12-20 16:13:28 +01:00
Rainer Gerhards
1b2769f5ec
travis: remove no longer needed Trusty install scripts
This also removes all remaining references to LLVM repos, as such
closes https://github.com/rsyslog/rsyslog/issues/2380
2019-11-14 16:59:29 +01:00
Rainer Gerhards
cfebaed413
travis: libmongoc-dev does not install all needed
there seem to be packaging changes in ubuntu or some other repos
we use on travis. This should fix the issue.
2019-08-09 12:33:20 +02:00
Nelson Yen
f72dbe4009 remove unneeded imdocker-unit-tests
Remove the compile time tests which are now redundant,
due to the variety of imdocker testbench tests.
2019-04-08 14:22:11 -07: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
Philippe Duveau
dff0e393f6 Create imbatchreport input module + parallel tests 2019-03-30 16:40:32 +01:00
Rainer Gerhards
e66bd10fe5
improg: add new module 2019-03-04 10:23:04 +01:00
Rainer Gerhards
614a03550e
testbench: fix issues with journal testing
The configure/Makefile checks were not correct, leading to the
build of journal components when not necessary, even if not
supported by the platform. Thus lead to invald build and test
failures. This commit fixes that.
2019-01-18 09:09:37 +01:00
Rainer Gerhards
c4003294dc
travis: do no longer run 0mq tests
This often causes trouble when the packages are rebuild by the 0mq project
(which happens frequently). We already do intensive testing of the 0mq
components in the buildbot infrastructure, where we use dedicated containers.
This is reliable, as the containers already contain everything needed and so
do not need to reach out to the 0mq package archives. In the light of this,
let's save us the trouble of Travis failures. The only downside is that
users cannot pre-test with their local Travis when modifying 0mq modules,
which is quite acceptable.
2019-01-18 09:09:13 +01:00
Rainer Gerhards
6cb60302c5
testbench: improve robustness against slow CI, gen. improvements
* add an overall timeout value for tests - if running longer,
  testbench framework tries to FAIL and end test. Note that
  this is not bullet-proof and not intended to be so.
* guard against hanging rsyslog instances via a new imdiag
  feature to abort after n number of seconds; among others,
  this guards as against timeout-cancel in CI, which is always
  pretty hard to diagnose - now we see these errors in test-suite.log
* fix a bug in tcp zip test, which actually did not use zip mode
* experimnentalls add debug output to better understand
  shutdown_when_empty operation; goal is to improve understanding
  and then remove that code again.
* improve shutdown predicate for a couple of tests
* made travis run make check with two parallel threads, for which
  we seem ready now. Nevertheless, it's still experimental and we
  may roll this back if required.
2018-12-28 13:03:57 +01:00
Rainer Gerhards
c37ec8292e
travis: more error message to diagnose travis issue 2018-11-14 14:17:38 +01:00
Rainer Gerhards
e551642316 testbench: add missing shebangs
detected by shellcheck
2018-10-01 12:00:31 +02:00
Rainer Gerhards
ca5452fe74
Merge pull request #2993 from PascalWithopf/m2782
add contrib module omhttp
2018-09-07 17:33:21 +02: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
9d0933bccf testbench: Added new kafka tests using kafkacat for better debugging.
Fixed some issues with sndrcv kafka tests.
Generating kafka topics dynamically now it kafka tests.

Limited messagecount in some tests to 50000 for now.
2018-09-05 11:55:33 +02:00
Rainer Gerhards
0bac6654c0 Travis: temporarily disable kafka tests
We already know they are currently unstable, so there is not point
in messing up CI result each time. The test will still be carried out
in nightly checks, so the problems won't be forgotten.
2018-07-29 14:38:11 +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
978cca35a7
Merge pull request #2405 from rgerhards/testbench-improve
some testbench improvements
2018-06-22 11:18:35 +02:00
Rainer Gerhards
9cf9f2e8b7 testbench: change elasticsearch tests to use new plumbing
This makes the ES tests more universally available (they should now
also support running in containers). It also simplifies the tests
as fewer support files are needed.
2018-06-18 17:12:08 +02:00
Rainer Gerhards
31ce76d135 travis: add checks for openssl drivers 2018-06-17 14:35:43 +02:00
Rainer Gerhards
bd8ea7e12e CI: add test to build without atomic operations
closes https://github.com/rsyslog/rsyslog/issues/2572
2018-03-21 16:57:50 +01:00
Rainer Gerhards
a28fbd3340 CI: fix check that tarball is built correctly 2018-03-04 11:09:13 +01:00
Rainer Gerhards
4f7c3438a7 testbench: do not override default Alpine CFLAGS
... as this brought us away from the abuild environment. Most importantly,
-Os was overriden by -O2, which did make a lot of warning go away.
2018-01-25 17:10:59 +01:00
Rainer Gerhards
b06a48d6b5 Travis: further collapse build matrix 2018-01-16 13:04:47 +01:00
Rainer Gerhards
89318b2dea travis: combine some build checks
... and do them via containers. This also reduces resource usage and
runtime on Travis a bit.
2018-01-15 18:07:06 +01:00
Rainer Gerhards
b89466e105 Travis: run static analyzer via standard dev container
also some improvements to somewhat optimize the build matrix so
that we avoid unnecessary work.
2018-01-14 13:56:27 +01:00
Rainer Gerhards
f356d9f399 Travis: check build on Alpine Linux and Ubunut rolling (via docker container) 2018-01-12 17:29:02 +01:00
Rainer Gerhards
0fcc9dc609 travis: reenable static analyzer
LLVM has changed packaging structure, this fix adapts to it. So we
now have scan-build-5.0 again.
2017-12-30 12:46:45 +01:00
Rainer Gerhards
44eacd7261 Travis: line length check was not run, re-enabling
This was a side-effect of disabling static analyzer, which we were forced to
due to missing LLVM packages.
2017-12-23 14:06:48 +01:00
Rainer Gerhards
57837d0dd7 Travis: enable omgssapi and usertools 2017-12-20 15:53:15 +01:00
Rainer Gerhards
4e04e2ee55 testbench: provide capability to split testbench
This is necessary as we hit the Travis max runtime limit per VM,
so we need to duplicate the tests. This is done via
--enable-testbench1 and --enable-testbench2 which we than use
in different VMs.

This PR also includes updates to the Travis scripts so that we
use the new capability. We have only duplicated Travis VMs where
acutally necessary -- we may need to do more of this in the future.

closes https://github.com/rsyslog/rsyslog/issues/2196
2017-12-11 11:22:14 +01:00
Dan Molik
f334e2b250 ompgsql plugin - update postgres module
The PostgreSQL output module was woefully out-of-date the following
list is changes made to update the module to current Rsyslog standards.

  - allow for v6 configuration syntax
  - configurable ports
  - support transactional interface
  - push db connection into workers (libpq is threadsafe)
  - enable module testing on travis
  - ensure configuration syntax backwards compatibility
  - formatting around postgres core templating
  - use new test conventions
  - add new configuration syntax test
  - add valgrind tests for new and old syntax
  - add threading tests
  - add action queue long running tests
  - add action queue valgrind test
2017-12-09 09:04:46 -05:00
Rainer Gerhards
8d8abf2d9b travis: enable gcc-7 with high warning levels
see also https://github.com/rsyslog/rsyslog/pull/2121
2017-11-29 12:39:07 +01:00
Rainer Gerhards
64992ddeee Travis: [io]mzmq3 cannot be built any longer
according to Brian Knox they require an outdated version of the client
lib. So we do not bother any longer about them. After all, they are
scheduled to be removed in 2018-01.
2017-11-26 16:42:09 +01:00
Rainer Gerhards
42fd7c7b78 travis: temporarily disable new autoconf-archive so that we can merge soon
the very new version introduced new warning compiler flags, which require
some work to fix build issues. We do not want to hold the rest of the
useful work in this commit set just for that. So we temporarily disable
the new package and will work in parallel to make things build cleanly
again.
2017-11-25 18:46:00 +01:00
Rainer Gerhards
0953b7c942 Travis: temporarily disable packages that make build fail 2017-11-25 18:46:00 +01:00
Rainer Gerhards
aeeecea3f2 Travis: prepare for use of newer autoconf-archive
thanks to whissi for the package!

see also https://github.com/rsyslog/rsyslog/issues/2102
2017-11-25 18:45:40 +01:00
Rainer Gerhards
95dfd548b4 travis: do more checks with gcc 7 2017-11-25 15:49:05 +01:00
Rainer Gerhards
4761cbdd68 travis: add gcc-7 based compile tests 2017-11-25 15:49:05 +01:00
Rainer Gerhards
4f2a1b9a38 travis: enable omsnmp in CI 2017-11-25 15:49:05 +01:00
Rainer Gerhards
0fe2de8f24
Merge pull request #1917 from jjourdin/master
Improvement on ommongodb: mongo-c-driver with TLS and replicaset
2017-11-23 15:31:48 +01:00
Rainer Gerhards
2a8af6b6f0 travis: enable build of [io]mzmq modules
now that we have the necessary prequisites, we can also build these
modules and make sure that actually works

closes https://github.com/rsyslog/rsyslog/issues/2047
2017-11-18 17:15:07 +01:00
Hugo SOSZYNSKI
1ab4bfb0e7 Corrected some compilation warning and errors.
No longer installing libmongo-client in Travis script.
2017-11-17 15:37:26 +01:00
Hugo SOSZYNSKI
f1ec0993c4 Merge from upstream/master 2017-11-17 09:45:22 +01:00
Rainer Gerhards
0d124d164a Travis: let build requirements not interfere with line length check 2017-11-16 13:47:47 +01:00
Rainer Gerhards
6c05f41269 Travis CI: add support for cron jobs and Coverity scan
We execute different code pathes under cron jobs. It doesn't make sense
to redo what we already did before a merge. Right now, cron builds a
Coverity scan submission and uploads it. This should be set to run
once a day.

closes https://github.com/rsyslog/rsyslog/issues/2037
2017-11-16 11:30:01 +01:00