SIGN IN SIGN UP

Fix event log timestamp parse error

The comment from 'getEventLogParams()' says:
    The redfish log format is "<Timestamp> <MessageId>,<MessageArgs>"

And in the OpenBMC main tree, the 'rsyslog.conf' from vendor defines:
    # Template for Redfish messages
    # "<timestamp> <MessageId>,<MessageArgs>"
    template(name="RedfishTemplate" type="list") {
        property(name="timereported" dateFormat="rfc3339")
        constant(value=" ")
        property(name="$!REDFISH_MESSAGE_ID")
        constant(value=",")
        property(name="$!REDFISH_MESSAGE_ARGS")
        constant(value="\n")
    }

    # If the journal entry has a Redfish MessageId, save as a Redfish
    # event
    if ($!REDFISH_MESSAGE_ID != "") then {
        action(type="omfile"
               file="/var/log/redfish"
               template="RedfishTemplate")
    }

The commit aa2dfd26a514 ("Remove static variables") removed extraction
of timestamp data from the whole event log entry, 'dateStringToEpoch()'
will reject this kind of timestamp with trailing text.

Fixes: aa2dfd26a514 ("Remove static variables")

Change-Id: Id59af476e56a913a02a9f56a8c5f38c4ada7ccbf
Signed-off-by: Haiyue Wang <haiyuewa@163.com>
H
Haiyue Wang committed
ab4232093264b4811695849851bc27137841f03d
Parent: 45b8680
Committed by Ed Tanous <ed@tanous.net> on 6/25/2026, 3:16:18 PM