1393 Commits

Author SHA1 Message Date
PascalWithopf
79de51e4fc codestyle: reduce max line length to 125 2017-12-20 16:16:57 +01:00
4486cc0131 imfile: implemented wildcard support into FEN mode (solaris)
Partitionally moved inotify code to global imfile code as needed
for FEN Mode.
Enabled all wildcard tests that are supported by FEN API.
2017-12-19 11:03:34 +01:00
Rainer Gerhards
6a140a2cb3 script engine: improper string-to-number conversion for negative numbers
Thanks to Stephen Workman for providing a very detailled hint of the
problem and root cause. This patch bases on his recommendation for a
fix.

closes https://github.com/rsyslog/rsyslog/issues/2255
2017-12-18 17:50:32 +01:00
Rainer Gerhards
a395a79879
Merge pull request #2146 from rgerhards/i-1977
rainerscript: new function "http_request"
2017-12-18 13:08:00 +01:00
Stephen Workman
d068170818 Fix test so it will run on FreeBSD. 2017-12-16 18:49:12 -05:00
Rainer Gerhards
49efb53985 rainerscript: new function "http_request"
closes https://github.com/rsyslog/rsyslog/issues/1977
2017-12-16 17:47:08 +01:00
Rainer Gerhards
0d6b3d47f7 testbench: fix new --enable-libfaketime configure option
some tests requiring faketime were executed even when this was
disabled
2017-12-16 16:26:07 +01:00
Rainer Gerhards
835d6b104b
Merge pull request #2233 from rgerhards/i-2212
testbench: name valgrind tests consitently (end with -vg.sh)
2017-12-16 16:19:00 +01:00
Rainer Gerhards
78356cdf1b testbench: name valgrind tests consitently (end with -vg.sh)
closes https://github.com/rsyslog/rsyslog/issues/2212
2017-12-16 12:19:28 +01:00
Rainer Gerhards
47c7d824db testbench: add a capability to turn off libfaketime tests via configure
Unfortunately, libfaketime becomes more and more problematic in newer
versions and causes aborts on some platforms. This provides the ability
to turn it off via --disable-libfaketime.

In the longer term, we should consider writing our own replacement.
2017-12-16 11:39:15 +01:00
Rainer Gerhards
a9601ebaec pmrfc3164: try to detected headerless message
headerless is indicated by whitespace followed by either '{' or '['.
This follows the trend to send JSON messages via syslog without any
header. We use default header values in this case.

This right now is a bit experimental; we may roll it back if
problems show up in practice.

closes https://github.com/rsyslog/rsyslog/issues/2030
2017-12-12 18:25:16 +01:00
Rainer Gerhards
f0f173325e
Merge pull request #2201 from rgerhards/testbench-timeout
testbench: reduce startup timeout for tests
2017-12-12 16:43:01 +01:00
Rainer Gerhards
23a41c87d4
Merge pull request #2198 from rgerhards/i-1979
config: implement function parse_json()
2017-12-12 16:42:43 +01:00
Rainer Gerhards
f23a1d3959 testbench: reduce startup timeout for tests
previous timeout caused very long runtime in cases where rsyslog
segfaulted on startup, which made the testbench failure harder to
diagnose than necessary.
2017-12-12 11:39:54 +01:00
Rainer Gerhards
0d0ff11991 config: implement function parse_json()
It is useful to be able to parse arbitrary JSON strings without the need
of an external message modification module. For example, together with
    https://github.com/rsyslog/rsyslog/issues/1977
this can be used to parse out specific fields from Amazon AWS
configuration info. There are also other ample uses for such functionality.

closes https://github.com/rsyslog/rsyslog/issues/1979
2017-12-12 11:35:29 +01:00
Rainer Gerhards
4d1e10ad46
Merge pull request #2191 from jgerhards/rscript_substring
rainerscript: implement substring function
2017-12-12 11:07:25 +01:00
Rainer Gerhards
a256b9ab77
Merge pull request #2195 from rgerhards/i-2192
testbench: do not run tests that require root permissions by default
2017-12-11 13:45:35 +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
Rainer Gerhards
5099df4319
Merge pull request #2188 from rgerhards/i-1939
RainerScript: implement previous_action_suspended() function
2017-12-11 10:26:23 +01:00
Rainer Gerhards
0a5ec439e7 testbench: do not run tests that require root permissions by default
Root permissions are uncommon in the CI environmen (requires very special
setup). Test skip if run under non-root, but that pollutes the
testbench result. So the default now is not to do that. The can still be
activated via --enable-root-tests configure switch.

closes https://github.com/rsyslog/rsyslog/issues/2192
2017-12-10 18:43:29 +01:00
Jan Gerhards
effee21a81 rainerscript: implement substring function 2017-12-10 14:24:46 +01:00
Rainer Gerhards
ce06bba15c RainerScript: implement previous_action_suspended() function
This function returns a boolean indicating if the previous action is
suspended (0 - no, 1 - yes). This is useful if arbitrary processing
(other than calling actions) should be made depending on that state.
A prime example for this is probably calling a ruleset.

closes https://github.com/rsyslog/rsyslog/issues/1939
2017-12-09 17:48:28 +01:00
Rainer Gerhards
2614b1803c
Merge pull request #2172 from GrayTShirt/pg
update postgres output module
2017-12-09 17:25:22 +01:00
Rainer Gerhards
4af883651e
Merge pull request #2185 from rgerhards/i-1978
RainerScript: add function script_error() and error-reporting support
2017-12-09 17:13:15 +01:00
Rainer Gerhards
b63d3051bc RainerScript: add function script_error() and error-reporting support
This permits script functions that could fail to report errors back, so
that the user can handle them if desired. We use an errno-style of
interface. That means script_error() needs to be called after functions
that supports it. It will return either 0 (all OK) or something else
(an error condition).

The commit also modifies the parse_time() function to use the new
interface. First of all, this is useful for users, and secondly we
needed a capability to craft a testbench test.

closes https://github.com/rsyslog/rsyslog/issues/1978
2017-12-09 16:08:36 +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
ba89fd38ab testbench cleanup
closes https://github.com/rsyslog/rsyslog/pull/2170
2017-12-09 13:39:30 +01:00
ed7ca31ce6 imkafka: Fixed memory leak in msgConsume
When rkmessage->err was set, rkmessage was not proberly destroyed with
rd_kafka_message_destroy.

Closes https://github.com/edenhill/librdkafka/issues/1536
2017-12-06 09:42:38 +01:00
Jan Gerhards
38d92ff814 rainerscript: bugfix
fix a bug causing a crash if rtrim or ltrim were called
with a string containing a blank and one single different character.

closes https://github.com/rsyslog/rsyslog/issues/2127
2017-12-02 18:26:39 +01:00
Rainer Gerhards
e6ea9a1ac6 testbench: enable more tests on BSD
... by fixing command lines that are not valid under BSD.
2017-12-02 10:32:01 +01:00
7508010750 Basic Imfile FEN API support for Solaris (#2141)
imfile: Initial implementation of solaris FEN API (without wildcards)

FEN API is used to implement simular event based file
monitoring like with inotify.

This commit provides partial functionality. It supports event-driven
processing of files but does not yet provide wildcard functionality.
Wildscards will be provided by a later commit.

This can be committed as-is because the previous code did also
not provide wildcard support, so this is an improvement for
Solaris in any case.

see also https://github.com/rsyslog/rsyslog/issues/1954
2017-12-01 12:49:38 +01: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
da01aae879
Merge pull request #2126 from mrworkman/rscript-parse-time-fix
Fix to work on systems where Python 3.x is the default.
2017-11-28 08:07:39 +01:00
Stephen Workman
04c903a05d Fix to work on systems where Python 3.x is the default. 2017-11-27 16:44:26 -05:00
Thomas Deutschmann
015aa2eee1
Normalize Python shebang and improve portability 2017-11-27 20:06:37 +01:00
Rainer Gerhards
5e27894a21
Merge pull request #2115 from janmejay/dynstats_time_constraint_relaxation
Relax time constraints for dynstats elapsed-time dependent tests
2017-11-27 08:18:54 +01:00
Janmejay Singh
6983bd3414 Make elapsed-time dependent dynstats tests run with relaxed time constraints as they sometimes fail on arm & hppa (and sometimes on other slow envs too) 2017-11-26 23:56:42 +05:30
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
289d4cead6
Merge pull request #2101 from PascalWithopf/i-1776
tcpflood: add err when parameter -Ttls is missing
2017-11-24 12:15:07 +01:00
Rainer Gerhards
dfe89f29e0
Merge pull request #2071 from rgerhards/es-testbench-additions
testbench: improvements in elasticsearch testing
2017-11-24 10:43:15 +01:00
PascalWithopf
3b5568b69c tcpflood: add err when parameter -Ttls is missing
When TLS certificates are specified but TLS is NOT enabled
tcpflood now exits with an error message.
This was decided as useful in https://github.com/rsyslog/rsyslog/issues/1776
2017-11-24 10:37:48 +01:00
Rainer Gerhards
cf425b2c36 testbench/omkafka: update valgrind test to more flexible test framework 2017-11-24 08:14:32 +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
a811fb8fb7 testbench: add basic test for omelasticsearch with ES 6.0 2017-11-21 15:29:48 +01:00