Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1620051

Summary: Lack of some fields when use Docker json driver
Product: Red Hat Enterprise Linux 7 Reporter: Anping Li <anli>
Component: rsyslogAssignee: Rich Megginson <rmeggins>
Status: CLOSED NOTABUG QA Contact: Anping Li <anli>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.6CC: anli, dapospis, jvymazal, rmeggins
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-22 14:10:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
journald container log
none
Json file container log none

Description Anping Li 2018-08-22 10:09:10 UTC
Description of problem:
Compared with Docker Journald log driver, the documents lack the following fields

CONTAINER_ID": "72367058f4e7"
CONTAINER_ID_FULL": "72367058f4e7b9107d252499db3dd13fdcfb0658c929d9738460abe541ad1d16",   
CONTAINER_NAME": "k8s_centos-logtest_centos-logtest-w7qkp_prj_f7c20fe9-a5eb-11e8-9ba7-fa163e68a0d
"hostname": "preserve-anli-rsyslognode-2"

Version-Release number of selected component (if applicable):
rsyslog-mmkubernetes-8.24.0-33.el7.x86_64
atomic-openshift-3.11.0-0.19.0
RHEL 7.6

How reproducible:
Always

Steps to Reproduce:
1. Deploy Logging v3.11 on OCP 3.11 on RHEL 7.6. (The log driver is json file by default)
2. Disable fluentd and deploy rsyslog as log collector
3. Deploy one pod and Save the pod log document from Elasticsearch
4. Change the docker driver to journald (Restart docker, atomic-openshift-node), redeploy pod and save the pod log from Elasticsearch.
5. compare the document save in step 3) and 4)

Actual results:
 diff container_rsyslog_imjournal.example container_rsyslog_jsonfile.example
4c4
<   "_id": "AWVg7POH7zRDgmFYGKlS",
---
>   "_id": "AWVhAtA1t1rZ02_LcUxE",
8,16c8,10
<     "message": "2018-08-22 09:17:46,134 - SVTLogger - INFO - centos-logtest-w7qkp : 110 : 2o38Em0Jk DcrgunZ0T IAhfkMBNs LhJpA5oUi e7ijcR2VH pvKum4QcO prx6erQQQ 2BJkz4X0K uAFcxcOOd 2BemUlull 92jwGMoGH iWpDyRNxZ dymVoitKv n0U9Ck8lx wKpIiByWT sW7oUvrJw sdBpV8IJy DYujctQ10 eCBfgEFlg 6IWAiAiVV ",
<     "level": "info",
<     "hostname": "preserve-anli-rsyslognode-2",
<     "@timestamp": "2018-08-22T05:17:46.134880-04:00",
<     "pipeline_metadata": {
<       "collector": {
<         "name": "rsyslog",
<         "inputname": "imjournal"
<       }
---
>     "metadata": {
>       "filename": "/var/log/containers/centos-logtest-49b67_prj_centos-logtest-98a059588ba56008d240644f0e8f2064a4581b14a3301561a6cebf4359f24c65.log",
>       "fileoffset": "62319"
18,22c12,14
<     "CONTAINER_ID": "72367058f4e7",
<     "CONTAINER_ID_FULL": "72367058f4e7b9107d252499db3dd13fdcfb0658c929d9738460abe541ad1d16",
<     "CONTAINER_NAME": "k8s_centos-logtest_centos-logtest-w7qkp_prj_f7c20fe9-a5eb-11e8-9ba7-fa163e68a0de_0",
<     "CONTAINER_TAG": "72367058f4e7",
<     "metadata": {},
---
>     "log": "2018-08-22 09:41:39,243 - SVTLogger - INFO - centos-logtest-49b67 : 182 : BV8V9ykY7 8isGABl2e v7AamrYk5 vwNQBxOHO 0AnIAArK3 I6ZCaRCvv uhMNX4NS4 r9nPcNLrQ m4AOvVocS LWqrs6BEN 0Q8jL5sz9 XLDyrIqUa y8W39QG9J aloZbI0eO P7XM55qN1 oM6MbRBRr r0NzPghtS ucqVrcIiW ZxXXlGp4o OdnFzEbZY \n",
>     "stream": "stderr",
>     "time": "2018-08-22T09:41:39.243510296Z",
34c26
<       "pod_id": "f7c20fe9-a5eb-11e8-9ba7-fa163e68a0de",
---
>       "pod_id": "492a791c-a5ed-11e8-9ba7-fa163e68a0de",
43c35
<       "pod_name": "centos-logtest-w7qkp",
---
>       "pod_name": "centos-logtest-49b67",
49c41
<       "container_id": "72367058f4e7b9107d252499db3dd13fdcfb0658c929d9738460abe541ad1d16"
---
>       "container_id": "98a059588ba56008d240644f0e8f2064a4581b14a3301561a6cebf4359f24c65"
51,70c43,52
<     "originalmsg": "2018-08-22 09:17:46,134 - SVTLogger - INFO - centos-logtest-w7qkp : 110 : 2o38Em0Jk DcrgunZ0T IAhfkMBNs LhJpA5oUi e7ijcR2VH pvKum4QcO prx6erQQQ 2BJkz4X0K uAFcxcOOd 2BemUlull 92jwGMoGH iWpDyRNxZ dymVoitKv n0U9Ck8lx wKpIiByWT sW7oUvrJw sdBpV8IJy DYujctQ10 eCBfgEFlg 6IWAiAiVV ",
<     "unparsed-data": "2018-08-22 09:17:46,134 - SVTLogger - INFO - centos-logtest-w7qkp : 110 : 2o38Em0Jk DcrgunZ0T IAhfkMBNs LhJpA5oUi e7ijcR2VH pvKum4QcO prx6erQQQ 2BJkz4X0K uAFcxcOOd 2BemUlull 92jwGMoGH iWpDyRNxZ dymVoitKv n0U9Ck8lx wKpIiByWT sW7oUvrJw sdBpV8IJy DYujctQ10 eCBfgEFlg 6IWAiAiVV ",
<     "systemd": {
<       "t": {
<         "MACHINE_ID": "34cdbef47b574f19a7abff702fddf1ac",
<         "BOOT_ID": "727be603076a415e8c51dea06f5cc7f2",
<         "CAP_EFFECTIVE": "1fffffffff",
<         "CMDLINE": "/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --authorization-plugin=rhel-push-plugin --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json --selinux-enabled --log-driver journald --signature-verification=False --storage-driver overlay2 --mtu=1450 --add-registry registry.redhat.io --block-registry registry.hacker.com --insecure-registry brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888 --insecure-registry virt-openshift-05.lab.eng.nay.redhat.com:5000 --insecure-registry virt-openshift-05.lab.eng.nay.redhat.com:5001 --insecure-registry registry.reg-aws.openshift.com:443 --insecure-registry asb-registry.usersys.redhat.com:5000 --add-registry registry.access.redhat.com",
<         "COMM": "dockerd-current",
<         "EXE": "/usr/bin/dockerd-current",
<         "GID": "0",
<         "HOSTNAME": "preserve-anli-rsyslognode-2",
<         "PID": "11541",
<         "SELINUX_CONTEXT": "system_u:system_r:container_runtime_t:s0",
<         "SOURCE_REALTIME_TIMESTAMP": "1534929466134559",
<         "SYSTEMD_CGROUP": "/system.slice/docker.service",
<         "SYSTEMD_SLICE": "system.slice",
<         "SYSTEMD_UNIT": "docker.service",
<         "TRANSPORT": "journal",
<         "UID": "0"
---
>     "originalmsg": "2018-08-22 09:41:39,243 - SVTLogger - INFO - centos-logtest-49b67 : 182 : BV8V9ykY7 8isGABl2e v7AamrYk5 vwNQBxOHO 0AnIAArK3 I6ZCaRCvv uhMNX4NS4 r9nPcNLrQ m4AOvVocS LWqrs6BEN 0Q8jL5sz9 XLDyrIqUa y8W39QG9J aloZbI0eO P7XM55qN1 oM6MbRBRr r0NzPghtS ucqVrcIiW ZxXXlGp4o OdnFzEbZY \n",
>     "unparsed-data": "2018-08-22 09:41:39,243 - SVTLogger - INFO - centos-logtest-49b67 : 182 : BV8V9ykY7 8isGABl2e v7AamrYk5 vwNQBxOHO 0AnIAArK3 I6ZCaRCvv uhMNX4NS4 r9nPcNLrQ m4AOvVocS LWqrs6BEN 0Q8jL5sz9 XLDyrIqUa y8W39QG9J aloZbI0eO P7XM55qN1 oM6MbRBRr r0NzPghtS ucqVrcIiW ZxXXlGp4o OdnFzEbZY \n",
>     "message": "2018-08-22 09:41:39,243 - SVTLogger - INFO - centos-logtest-49b67 : 182 : BV8V9ykY7 8isGABl2e v7AamrYk5 vwNQBxOHO 0AnIAArK3 I6ZCaRCvv uhMNX4NS4 r9nPcNLrQ m4AOvVocS LWqrs6BEN 0Q8jL5sz9 XLDyrIqUa y8W39QG9J aloZbI0eO P7XM55qN1 oM6MbRBRr r0NzPghtS ucqVrcIiW ZxXXlGp4o OdnFzEbZY \n",
>     "hostname": "preserve-anli-rsyslognode-2",
>     "@timestamp": "2018-08-22T09:41:39.243510296Z",
>     "level": "err",
>     "pipeline_metadata": {
>       "collector": {
>         "name": "rsyslog",
>         "inputname": "imfile"
76c58
<       1534929466134
---
>       1534930899243
80c62
<     1534929466134
---
>     1534930899243



Expected results:


Additional info:

Comment 2 Anping Li 2018-08-22 10:11:35 UTC
Created attachment 1477837 [details]
journald container log

Comment 3 Anping Li 2018-08-22 10:12:00 UTC
Created attachment 1477838 [details]
Json file container log

Comment 5 Rich Megginson 2018-08-22 14:10:19 UTC
This bug has nothing to do with rsyslog itself - this is about configuration and/or the ansible playbooks used to deploy rsyslog.  We don't really have a category for that (we don't even have an official set of ansible playbooks for rsyslog yet).  So this is definitely NOTABUG as far as rsyslog is concerned.

Next - there is definitely a difference in the data between json-file and journald.  Fields such as 

<     "CONTAINER_ID": "72367058f4e7",
<     "CONTAINER_ID_FULL": "72367058f4e7b9107d252499db3dd13fdcfb0658c929d9738460abe541ad1d16",
<     "CONTAINER_NAME": "k8s_centos-logtest_centos-logtest-w7qkp_prj_f7c20fe9-a5eb-11e8-9ba7-fa163e68a0de_0",
<     "CONTAINER_TAG": "72367058f4e7",

only exist in journald data, and fields such as 

>     "log": "2018-08-22 09:41:39,243 - SVTLogger - INFO - centos-logtest-49b67 : 182 : BV8V9ykY7 8isGABl2e v7AamrYk5 vwNQBxOHO 0AnIAArK3 I6ZCaRCvv uhMNX4NS4 r9nPcNLrQ m4AOvVocS LWqrs6BEN 0Q8jL5sz9 XLDyrIqUa y8W39QG9J aloZbI0eO P7XM55qN1 oM6MbRBRr r0NzPghtS ucqVrcIiW ZxXXlGp4o OdnFzEbZY \n",
>     "stream": "stderr",
>     "time": "2018-08-22T09:41:39.243510296Z",

only exist in json-file data.

Can you provide which ansible playbooks you used to deploy rsyslog?

Comment 6 Anping Li 2018-09-04 01:04:16 UTC
Rich,  I am using your playbook origin-aggregated-logging/hack/testing/rsyslog/playbook.yaml.