Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-39979

Lognormalizer parsing issue

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • rhel-10.0.beta
    • rhel-10.0.beta
    • liblognorm
    • None
    • liblognorm-2.0.6-14.el10
    • None
    • None
    • rhel-security-special-projects
    • ssg_security
    • 26
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • 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

      1. git clone https://gitlab.cee.redhat.com/special-projects/tests/liblognorm.git
      2. 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 ===

      { "field0": "nonempty", "field1": "", "field2": [ ], "field3": [ "nonepty" ] }

      :: [ 04:23:29 ] :: [ BEGIN ] :: Running 'logger '

      {"field0":"nonempty","field1":"","field2":[],"field3": ["nonepty"]}

      ''
      :: [ 04:23:29 ] :: [ PASS ] :: Command 'logger '

      {"field0":"nonempty","field1":"","field2":[],"field3": ["nonepty"]}

      '' (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 

              rh-ee-alakatos Attila Lakatos
              pkoncity2 Patrik Končitý
              Attila Lakatos Attila Lakatos
              SSG Security QE SSG Security QE
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: