-
Bug
-
Resolution: Done
-
Normal
-
rhel-10.0.beta
-
None
-
liblognorm-2.0.6-14.el10
-
None
-
None
-
rhel-security-special-projects
-
ssg_security
-
26
-
None
-
False
-
False
-
-
No
-
None
-
-
Pass
-
-
Automated
-
Unspecified Release Note Type - Unknown
-
None
What were you trying to do that didn't work?
Lognormalizer is parsing json incorrectly and the parsed json contains an empty field for which the empty field skip rule is set.
Please provide the package NVR for which bug is seen:
liblognorm-2.0.6-12.el10.x86_64
How reproducible:
Always, run test.
Steps to reproduce
- git clone https://gitlab.cee.redhat.com/special-projects/tests/liblognorm.git
- in working dir $ tmt --context distro=rhel-10.0 run plan --default -vvv prepare discover -h fmf -t /Regression/bz156 -vv provision -h connect --guest IP -u USER -p PASSWORD execute --how tmt --interactive login finish
Expected results
lognormalizer shouldn't show after parse empty json fields.
Actual results
:: [ 04:23:29 ] :: [ PASS ] :: Command 'echo '
{"field0":"nonempty","field1":"","field2":[],"field3": ["nonepty"]}' | lognormalizer -r /etc/rsyslog.d/rulebase.rb -e json' (Expected 0, got 0)
:: [ 04:23:29 ] :: [ FAIL ] :: File '/var/tmp/rlRun_LOG.odVSL4Y8' should contain '"field0": "nonempty", "field3": [ "nonepty" ]'
=== /var/tmp/rlRun_LOG.odVSL4Y8 ===
:: [ 04:23:29 ] :: [ BEGIN ] :: Running 'logger '
{"field0":"nonempty","field1":"","field2":[],"field3": ["nonepty"]}''
:: [ 04:23:29 ] :: [ PASS ] :: Command 'logger '
'' (Expected 0, got 0)
:: [ 04:23:32 ] :: [ FAIL ] :: File '/var/log/skipempty-logfile' should contain '"field0": "nonempty", "field3": [ "nonepty" ]
[1] https://artifacts.osci.redhat.com/testing-farm/314aee54-4869-4c64-bb90-62eac17aa62d/work-general2rkz1tsj/Plans/general/execute/data/guest/default-0/Regression/bz1565219-Add-skipempty-to-liblognorm-json-field-type-for-1/output.txt
- links to
-
RHBA-2024:137472 liblognorm update