diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 7cd7895..1cb8791 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -328,6 +328,7 @@
                                                uint32_t auxInfo)
 {
     std::string firmware;
+    int instance = (target & targetInstanceMask) >> targetInstanceShift;
     target = (target & selEvtTargetMask) >> selEvtTargetShift;
 
     /* make sure the status is 0, 1, or 2 as per the spec */
@@ -335,6 +336,11 @@
     {
         return ipmi::response(ipmi::ccInvalidFieldRequest);
     }
+    /* make sure the target is 0, 1, 2, or 4 as per the spec */
+    if (target > 4 || target == 3)
+    {
+        return ipmi::response(ipmi::ccInvalidFieldRequest);
+    }
     /*orignal OEM command is to record OEM SEL.
     But openbmc does not support OEM SEL, so we redirect it to redfish event
     logging. */
@@ -344,8 +350,7 @@
     {
         case FWUpdateTarget::targetBMC:
             firmware = "BMC";
-            buildInfo = " major: " + std::to_string(majorRevision) +
-                        " minor: " +
+            buildInfo = "major: " + std::to_string(majorRevision) + " minor: " +
                         std::to_string(bcdToDec(minorRevision)) + // BCD encoded
                         " BuildID: " + std::to_string(auxInfo);
             buildInfo += std::to_string(auxInfo);
@@ -353,7 +358,7 @@
         case FWUpdateTarget::targetBIOS:
             firmware = "BIOS";
             buildInfo =
-                " major: " +
+                "major: " +
                 std::to_string(bcdToDec(majorRevision)) + // BCD encoded
                 " minor: " +
                 std::to_string(bcdToDec(minorRevision)) + // BCD encoded
@@ -366,7 +371,7 @@
         case FWUpdateTarget::targetME:
             firmware = "ME";
             buildInfo =
-                " major: " + std::to_string(majorRevision) + " minor1: " +
+                "major: " + std::to_string(majorRevision) + " minor1: " +
                 std::to_string(bcdToDec(minorRevision)) + // BCD encoded
                 " minor2: " +
                 std::to_string(bcdToDec(static_cast<uint8_t>(auxInfo >> 0))) +
@@ -377,37 +382,43 @@
             break;
         case FWUpdateTarget::targetOEMEWS:
             firmware = "EWS";
-            buildInfo = " major: " + std::to_string(majorRevision) +
-                        " minor: " +
+            buildInfo = "major: " + std::to_string(majorRevision) + " minor: " +
                         std::to_string(bcdToDec(minorRevision)) + // BCD encoded
                         " BuildID: " + std::to_string(auxInfo);
             break;
     }
 
+    static const std::string openBMCMessageRegistryVersion("0.1");
+    std::string redfishMsgID = "OpenBMC." + openBMCMessageRegistryVersion;
+
     switch (status)
     {
         case 0x0:
             action = "update started";
+            redfishMsgID += ".FirmwareUpdateStarted";
             break;
         case 0x1:
             action = "update completed successfully";
+            redfishMsgID += ".FirmwareUpdateCompleted";
             break;
         case 0x2:
             action = "update failure";
+            redfishMsgID += ".FirmwareUpdateFailed";
             break;
         default:
             action = "unknown";
             break;
     }
 
-    std::string message(
-        "[firmware update] " + firmware + " instance: " +
-        std::to_string((target & targetInstanceMask) >> targetInstanceShift) +
-        " status: <" + action + ">" + buildInfo);
-    static constexpr const char* redfishMsgId = "FirmwareUpdate";
+    std::string firmwareInstanceStr =
+        firmware + " instance: " + std::to_string(instance);
+    std::string message("[firmware update] " + firmwareInstanceStr +
+                        " status: <" + action + "> " + buildInfo);
 
     sd_journal_send("MESSAGE=%s", message.c_str(), "PRIORITY=%i", LOG_INFO,
-                    "REDFISH_MESSAGE_ID=%s", redfishMsgId, NULL);
+                    "REDFISH_MESSAGE_ID=%s", redfishMsgID.c_str(),
+                    "REDFISH_MESSAGE_ARGS=%s,%s", firmwareInstanceStr.c_str(),
+                    buildInfo.c_str(), NULL);
     return ipmi::responseSuccess();
 }
 
