diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 3b9069f..943e08e 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -421,8 +421,8 @@
                 }
                 std::time_t timestamp;
                 uint64_t size = 0;
-                entriesArray.push_back({});
-                nlohmann::json& thisEntry = entriesArray.back();
+                std::string dumpStatus;
+                nlohmann::json thisEntry;
 
                 std::string entryID = object.first.filename();
                 if (entryID.empty())
@@ -432,7 +432,26 @@
 
                 for (auto& interfaceMap : object.second)
                 {
-                    if (interfaceMap.first == "xyz.openbmc_project.Dump.Entry")
+                    if (interfaceMap.first ==
+                        "xyz.openbmc_project.Common.Progress")
+                    {
+                        for (auto& propertyMap : interfaceMap.second)
+                        {
+                            if (propertyMap.first == "Status")
+                            {
+                                auto status = std::get_if<std::string>(
+                                    &propertyMap.second);
+                                if (status == nullptr)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    break;
+                                }
+                                dumpStatus = *status;
+                            }
+                        }
+                    }
+                    else if (interfaceMap.first ==
+                             "xyz.openbmc_project.Dump.Entry")
                     {
 
                         for (auto& propertyMap : interfaceMap.second)
@@ -474,6 +493,14 @@
                     }
                 }
 
+                if (dumpStatus != "xyz.openbmc_project.Common.Progress."
+                                  "OperationStatus.Completed" &&
+                    !dumpStatus.empty())
+                {
+                    // Dump status is not Complete, no need to enumerate
+                    continue;
+                }
+
                 thisEntry["@odata.type"] = "#LogEntry.v1_7_0.LogEntry";
                 thisEntry["@odata.id"] = dumpPath + entryID;
                 thisEntry["Id"] = entryID;
@@ -498,6 +525,7 @@
                         "/redfish/v1/Systems/system/LogServices/Dump/Entries/" +
                         entryID + "/attachment";
                 }
+                entriesArray.push_back(std::move(thisEntry));
             }
             asyncResp->res.jsonValue["Members@odata.count"] =
                 entriesArray.size();
@@ -552,10 +580,30 @@
                 foundDumpEntry = true;
                 std::time_t timestamp;
                 uint64_t size = 0;
+                std::string dumpStatus;
 
                 for (auto& interfaceMap : objectPath.second)
                 {
-                    if (interfaceMap.first == "xyz.openbmc_project.Dump.Entry")
+                    if (interfaceMap.first ==
+                        "xyz.openbmc_project.Common.Progress")
+                    {
+                        for (auto& propertyMap : interfaceMap.second)
+                        {
+                            if (propertyMap.first == "Status")
+                            {
+                                auto status = std::get_if<std::string>(
+                                    &propertyMap.second);
+                                if (status == nullptr)
+                                {
+                                    messages::internalError(asyncResp->res);
+                                    break;
+                                }
+                                dumpStatus = *status;
+                            }
+                        }
+                    }
+                    else if (interfaceMap.first ==
+                             "xyz.openbmc_project.Dump.Entry")
                     {
                         for (auto& propertyMap : interfaceMap.second)
                         {
@@ -595,6 +643,17 @@
                     }
                 }
 
+                if (dumpStatus != "xyz.openbmc_project.Common.Progress."
+                                  "OperationStatus.Completed" &&
+                    !dumpStatus.empty())
+                {
+                    // Dump status is not Complete
+                    // return not found until status is changed to Completed
+                    messages::resourceNotFound(asyncResp->res,
+                                               dumpType + " dump", entryID);
+                    return;
+                }
+
                 asyncResp->res.jsonValue["@odata.type"] =
                     "#LogEntry.v1_7_0.LogEntry";
                 asyncResp->res.jsonValue["@odata.id"] = dumpPath + entryID;
