12174 Commits

Author SHA1 Message Date
Rainer Gerhards
ec088aee94 fmhttps bugfix: missing configure check for libcurl
closes https://github.com/rsyslog/rsyslog/issues/2613
2018-04-04 08:30:29 +02:00
Rainer Gerhards
1c7d675f15 bump version number for next dev cycle 2018-04-03 12:07:01 +02:00
Rainer Gerhards
12056dd7f0 prepare for 8.34.0 release v8.34.0 2018-04-03 11:50:06 +02:00
Rainer Gerhards
70d4f725d9 Merge branch 'master' into v8-stable 2018-04-03 11:46:25 +02:00
Rainer Gerhards
e897f5ca4c maintain ChangeLog 2018-04-03 11:44:38 +02:00
Rainer Gerhards
64b6f5f7b9
Merge pull request #2607 from rgerhards/merge2509
Merge #2509
2018-04-03 11:39:48 +02:00
Rainer Gerhards
a1f5da069a
Merge pull request #2606 from rgerhards/omfile-hardened
merge #2490 as experimental module
2018-04-03 10:52:28 +02:00
Rainer Gerhards
4356b0a654 Merge branch 'master' of https://github.com/jduerstock/rsyslog into merge2509 2018-04-03 09:20:33 +02:00
Rainer Gerhards
bf0bff78f2 ChangeLog: fix incomplete sentence 2018-04-03 09:19:42 +02:00
Rainer Gerhards
5b73e452bb maintain ChangeLog 2018-04-03 09:13:46 +02:00
Rainer Gerhards
ab42698f67
Merge pull request #2367 from loiklo/imtcp-keepalive
Fix tcp keepalive settings assignment
2018-04-03 09:04:48 +02:00
Rainer Gerhards
df3db2cd1c
Merge pull request #2565 from rgerhards/fix-journal-tests
testbench bugfix: journal tests did not actually check for success
2018-04-03 09:00:09 +02:00
Mikko Kortelainen
6d7663342b omfile-hardened: add hardening
replaces and closes https://github.com/rsyslog/rsyslog/pull/2490
2018-04-03 08:47:21 +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
Rainer Gerhards
92cdd28c76 testbench bugfix: journal tests did not actually check for success
For some unknown reason, the check if data really was forwarded from
the journal was missing.

see also https://github.com/rsyslog/rsyslog/issues/2564
2018-04-01 18:21:12 +02:00
Rainer Gerhards
c325b096e9 maintain ChangeLog 2018-04-01 18:18:10 +02:00
Rainer Gerhards
83227f3452
Merge pull request #2601 from jsiwrk/bug/omprog_fd_leak
omprog: corrected fd leak with confirmMessages=on
2018-04-01 18:14:57 +02:00
Rainer Gerhards
30136adbde
Merge pull request #2602 from rgerhards/ci-freebsd-imfile
testbench: address failure on FreeBSD
2018-04-01 18:13:02 +02:00
Rainer Gerhards
d9d32b3cd5 maintain ChangeLog 2018-04-01 14:41:08 +02:00
Rainer Gerhards
140d579cb5
Merge pull request #2569 from bruce87en/master
omkafka: fix 'instanceData' has no member named 'mutCurrPartition'
2018-04-01 14:35:56 +02:00
Rainer Gerhards
4fcfc1b429
Merge pull request #2603 from rgerhards/cid188771
imfile: fix ressource leak in just-refactored code
2018-04-01 14:11:38 +02:00
Rainer Gerhards
10149e2ac1 imfile: fix ressource leak in just-refactored code
Coverity Scan detected a file handle leak. This was introduced in the
refactoring done in the past couple of days. Was NOT present in any
released code, so is nothing to really care about.

fixes Coverity Scan ID 188771
2018-04-01 12:01:17 +02:00
Rainer Gerhards
b51435ab3d
Merge pull request #2593 from rgerhards/i2529-bis
imfile: re-enable support for readind old-style state files
2018-04-01 11:56:25 +02:00
Rainer Gerhards
ba7b71277f testbench: address failure on FreeBSD
test imfile-endregex-timeout-with-shutdown-polling.sh fails, most probably
due to bad timing.
2018-04-01 10:48:05 +02:00
Rainer Gerhards
8e71447e04
Merge pull request #2596 from rgerhards/cid185415
"fix" some Coverity Scan cosmetic issues
2018-04-01 10:33:24 +02:00
Joan Sala
566aee96ff omprog: corrected fd leak with confirmMessages=on 2018-03-31 23:57:33 +02:00
Rainer Gerhards
c49568c7fe imfile: if inotify mode is selected on solaris, use FEN instead
both provide equal functionality, so it only makes sense to
select the analogous mode.
2018-03-30 17:03:04 +02:00
Rainer Gerhards
039b395f37 imfile: re-enable support for reading old-style state files
see also https://github.com/rsyslog/rsyslog/issues/2231#issuecomment-376862280
2018-03-30 17:02:56 +02:00
Rainer Gerhards
76dccef817 fix cosmetic Coverity Scan ID 185316 2018-03-29 18:52:21 +02:00
Rainer Gerhards
9e1dd8fda4 mmaudit: fix cosmetic Coverity Scan ID 185415 2018-03-29 18:50:55 +02:00
Rainer Gerhards
da7d9ab3b7
Merge pull request #2589 from rgerhards/i2529
imfile: refactor state file format
2018-03-29 10:53:14 +02:00
Rainer Gerhards
d5cadd26d4 imfile: refactor state file format
We change it to json and also change the way it is stored and loaded.
This sets base to additional improvements in imfile.

closes https://github.com/rsyslog/rsyslog/issues/2529
2018-03-29 09:15:27 +02:00
Rainer Gerhards
6bca17001f maintain ChangeLog 2018-03-29 09:11:54 +02:00
Rainer Gerhards
c4577375c2
Merge pull request #2466 from portante/mmk8s
Add the mmkubernetes plugin
2018-03-29 09:00:10 +02:00
Rich Megginson
a6264bf8f9 Kubernetes Metadata plugin - mmkubernetes
This plugin is used to annotate records logged by Kubernetes containers.
It will add the namespace uuid, pod uuid, pod and namespace labels and
annotations, and other metadata associated with the pod and namespace.
It will work with either log files in `/var/log/containers/*.log` or
with journald entries with `CONTAINER_NAME` and `CONTAINER_ID_FULL`.

For file logs, the filename must match this regex:

    /var/log/containers/([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_([^_]+)_(.+)-([a-z0-9]{64})\\.log$

The first match is the pod name, the second is the container hash (not
currently used), the third is the namespace name, the fourth is the
container name, and the fifth is the container id.  You can specify a
different regex by using the module or action configuration parameter
`filenameregex` but keep in mind that the field positions are hardcoded
so the regex must have the same fields in the same order.

For journald logs, there must be a field `CONTAINER_NAME` which matches this:

    ^[^_]+_([^\\._]+)(\\.([^_]+))?_([^_]+)_([^_]+)_[^_]+_[^_]+$

The first match is the container name, the second is the container hash
(not currently used), the third is the pod name, and the fourth is the
namespace name.  The record must also have the field
`CONTAINER_ID_FULL`.  You can specify a different regex by using the
module or action configuration parameter `containerregex` but keep in
mind that the field positions are hardcoded so the regex must have the
same fields in the same order.

The Kubernetes metadata is added to the record in the top-level fields
`kubernetes` and `docker`.  See
https://github.com/ViaQ/elasticsearch-templates/blob/master/namespaces/kubernetes.yml
and
https://github.com/ViaQ/elasticsearch-templates/blob/master/namespaces/docker.yml
for more details.

*Configuration*
`kubernetesurl` - Required - URL of the Kubernetes API server e.g.
                  `https://localhost:8443`
`tls.cacert` - Required - full path and file name of file containing
               the CA cert of the Kubernetes API server cert issuer
`tokenfile` - Required (or `token`) - the file containing the token
              to use to authenticate to the Kubernetes API server
`token` - Required (or `tokenfile`) - the token to use to
          authenticate to the Kubernetes API server
`annotation_match` - Optional - by default no pod or namespace annotations
                     will be added to the records - this parameter is an
                     array of patterns to match the keys of the `annotations`
                     field to include in the `annotations` field or the
                     `namespace_annotations` field.

*Example*

    module(load="imfile" mode="inotify")
    module(load="mmkubernetes" kubernetesurl="https://localhost:8443"
        tls.cacert="/etc/rsyslog.d/mmk8s.ca.crt"
        tokenfile="/etc/rsyslog.d/mmk8s.token" annotation_match=["."])

    template(name="tpl" type="list") {
        property(name="jsonmesg")
        constant(value="\n")
    }

    ruleset(name="k8s") {
        action(type="mmkubernetes")
        action(type="omfile" file="/var/log/k8s.log" template="tpl")
    }

    input(type="imfile" file="/var/log/containers/*.log" tag="kubernetes" addmetadata="on" ruleset="k8s")
    if ($!_SYSTEMD_UNIT == "docker.service") and (strlen($!CONTAINER_NAME) > 0) then {
        call k8s
    }

*Notes*

We use lognorm instead of regex to parse filenames and CONTAINER_NAME
since it is faster than regex and this parsing is in the critical path.

We cannot use ln_loadSamplesFromString with liblognorm 2.0.2, so
disallow the filenamerules and containerrules parameters for older
rsyslog versions with the older liblognorm.

Due to a limitation in mmnormalize, we cannot directly parse a filename
like this:

    something_something_this-is-a-container-name-092039840293.log

That is, we cannot handle a container name with `-` in it.  Instead,
parse the entire name + id into container_name_and_id, then parse into
separate container_name and container_id in the code.

*Credits*

This work is based on https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter
and has many of the same features.
2018-03-28 15:46:55 -04:00
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
Rainer Gerhards
1c78e8c59e
Merge pull request #2590 from rgerhards/lgtm-mmkubernetes
CI: enable mmkubernates in lgtm.com static analyzer
2018-03-28 16:09:38 +02:00
Rainer Gerhards
974769bf4d
Merge pull request #2591 from rgerhards/disable-omprog
testbench: disable omprog-transactions-failed-messages.sh on solaris
2018-03-28 15:49:45 +02:00
Rainer Gerhards
4544abd19e testbench: disable omprog-transactions-failed-messages.sh on solaris
test consistently fails

see also https://github.com/rsyslog/rsyslog/issues/2403
2018-03-28 10:30:56 +02:00
Rainer Gerhards
91d89ef1fd
Merge pull request #2587 from rgerhards/i2524
core: disable script optimizer warning
2018-03-28 10:10:05 +02:00
Rainer Gerhards
cf87168929 CI: enable mmkubernates in lgtm.com static analyzer 2018-03-28 09:08:25 +02:00
Rainer Gerhards
7bb1a91bac core: disable script optimizer warning
... as it causes issues. Plan is to fix and re-enable with next release.

see also https://github.com/rsyslog/rsyslog/issues/2524
2018-03-27 11:52:39 +02:00
Rainer Gerhards
70cc610fb7 maintain ChangeLog 2018-03-27 09:13:40 +02:00
Rainer Gerhards
f8de6179ce
Merge pull request #2573 from rgerhards/i2572
CI: test build of all components without atomic operations
2018-03-27 09:11:10 +02:00
Rainer Gerhards
faf41462d2
Merge pull request #2533 from rgerhards/i2359-imfile-data-structures
imfile: refactoring
2018-03-22 10:03:58 +01:00
Rainer Gerhards
ab1bd8c01b imfile: large refactoring of complete module
This commit greatly refactors imfile internal workings. It changes the
handling of inotify, FEN, and polling modes. Mostly unchanged is the
processing of the way a file is read and state files are kept.

This is about a 50% rewrite of the module.

Polling, inotify, and FEN modes now use greatly unified code. Some
differences still exists and may be changed with further commits. The
internal handling of wildcards and file detection has been completely
re-written from scratch. For example, previously when multi-level
wildcards were used these were not reliably detected. The code also
now provides much of the same functionality in all modes, most importantly
wildcards are now also supported in polling mode.

The refactoring sets ground for further enhancements and smaller
refactorings. This commit provides the same feature set that imfile
had previously and all existing CI tests pass, as do some newly
created tests.

Some specific changes:
- bugfix: module parameter "sortfiles" ignored
  This parameter only works in Solaris FEN mode, but is otherwise
  ignored.  Most importantly it is ignored under Linux.
  fixes https://github.com/rsyslog/rsyslog/issues/2528
- bugfix: imfile did not pick up all files when not present
  at startup
  fixes https://github.com/rsyslog/rsyslog/issues/2241
  fixes https://github.com/rsyslog/rsyslog/issues/2230
  fixes https://github.com/rsyslog/rsyslog/issues/2354
- bugfix: directories only support "*" wildcard, no others
  fixes https://github.com/rsyslog/rsyslog/issues/2303
- bugfix: parameter "sortfiles" did only work in FEN mode
  fixes https://github.com/rsyslog/rsyslog/issues/2528
- provides the ability to dynamically add and remove files via
  multi-level wildcards
  see also https://github.com/rsyslog/rsyslog/issues/1280
- the state file name currently has been changed to inode number
  This will further be worked on in upcoming PRs
  see also https://github.com/rsyslog/rsyslog/issues/2231
- some enhancements were also done to CI tests, most importantly
  they were made more compatibile with BSD

Note that most of the mentioned bug fixes cannot be applied to older
versions, as they fix design issues which are solved by the refactoring.
Thus there are not separate commits for them.

Distro maintainers: you need to decide to apply this patch as whole
or not. Believe me, it is not worth the effort to try to extract
specific patches from this commit. There is a good reason we do
not have multiple commits.

closes https://github.com/rsyslog/rsyslog/issues/2359
2018-03-22 08:25:47 +01: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
ede56adbaf build system: provide option to build without atomic operations
see also https://github.com/rsyslog/rsyslog/issues/2572
2018-03-21 16:57:05 +01:00
Rainer Gerhards
852214dfa7
Merge pull request #2556 from rgerhards/testbench-cleanup
testbench: improve cleanup
2018-03-21 16:03:55 +01:00
Rainer Gerhards
8e0962d579
Merge pull request #2571 from rgerhards/testbench-disble-omprog
testbench: temporarily disable more racy omprog tests
2018-03-21 14:30:27 +01:00