RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1609023 - mmkubernetes - stops working when non-kubernetes container name is read
Summary: mmkubernetes - stops working when non-kubernetes container name is read
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.6
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Rich Megginson
QA Contact: Anping Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-26 18:29 UTC by Rich Megginson
Modified: 2018-10-30 10:18 UTC (History)
5 users (show)

Fixed In Version: rsyslog-8.24.0-31.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-10-30 10:17:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rsyslog rsyslog pull 2881 0 None closed mmkubernetes: stops working with non-kubernetes container names 2020-01-27 13:22:47 UTC
Red Hat Bugzilla 1539193 0 high CLOSED RFE: Support for mm kubernetes plugin 2021-06-10 14:21:52 UTC
Red Hat Product Errata RHEA-2018:3135 0 None None None 2018-10-30 10:18:06 UTC

Internal Links: 1539193

Description Rich Megginson 2018-07-26 18:29:08 UTC
Description of problem:
mmkubernetes works fine if the container names are of the form that match the rulebase:

rule=:%k8s_prefix:char-to:_%_%container_name:char-to:.%.%container_hash:char-to:_%_%pod_name:char-to:_%_%namespace_name:char-to:_%_%not_used_1:char-to:_%_%not_used_2:rest%
 rule=:%k8s_prefix:char-to:_%_%container_name:char-to:_%_%pod_name:char-to:_%_%namespace_name:char-to:_%_%not_used_1:char-to:_%_%not_used_2:rest%

but if the CONTAINER_NAME field has a plain docker name e.g. CONTAINER_NAME=test-container then mmkubernetes gives an error and rsyslog suspends it, so it appears to stop working, and further records are not annotated

Version-Release number of selected component (if applicable):


How reproducible:
every time

Steps to Reproduce:
1. deploy openshift with docker log-driver=journald and rsyslog with mmkubernetes
2. run a container using docker that outputs log messages (i.e. prints to stdout/stderr - docker logs returns something)
3. once rsyslog reads this record, it stops annotating subsequent records

Actual results:


Expected results:


Additional info:

Comment 1 openshift-github-bot 2018-07-26 23:35:50 UTC
Commit pushed to master at https://github.com/openshift/origin-aggregated-logging

https://github.com/openshift/origin-aggregated-logging/commit/b916865e4006358fac5278b2d44d5b22c6382f0d
parse embedded json in log/MESSAGE fields

use mmnormalize with `.:json` to parse embedded JSON strings
in the `$!MESSAGE` and `$!log` fields into top level fields in
the record.
Refactor the parsing code into viaq_formatting where all of the
viaq data model specific formatting lives.
Add additional metadata fields such as received_at, file, offset
Clean up code around timestamps to avoid .operations... indices
with no dates.

workaround for bug 1609023

https://bugzilla.redhat.com/show_bug.cgi?id=1609023
the return value of ln_normalize does not differentiate between
a hard error and the no match case.  The workaround is to make
sure there is always a match for CONTAINER_NAME, and let the
mmkubernetes code determine there is no match due to missing
pod and namespace name.

Comment 3 Rich Megginson 2018-07-27 13:26:14 UTC
PR was merged upstream - https://github.com/rsyslog/rsyslog/commit/9535835460e79c132f7a259bc2d198a4aae6c6d4

Comment 10 Anping Li 2018-09-04 16:47:47 UTC
The fix works weel in OCP 3.11 and ryslog-8.24.0-34. @dapospis, You can move to next status.

atomic-openshift-3.11.0-0.25.0.git.0.a95c194.el7.x86_64
rsyslog-8.24.0-34.el7.x86_64
rsyslog-mmjsonparse-8.24.0-34.el7.x86_64
rsyslog-mmnormalize-8.24.0-34.el7.x86_64
rsyslog-elasticsearch-8.24.0-34.el7.x86_64
rsyslog-mmkubernetes-8.24.0-34.el7.x86_64

Comment 13 errata-xmlrpc 2018-10-30 10:17:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:3135


Note You need to log in before you can comment on or make changes to this bug.