diff --git a/orchagent/port/porthlpr.cpp b/orchagent/port/porthlpr.cpp index 80029cb569..3f937104ac 100644 --- a/orchagent/port/porthlpr.cpp +++ b/orchagent/port/porthlpr.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -777,6 +778,8 @@ bool PortHelper::parsePortConfig(PortConfig &port) const { SWSS_LOG_ENTER(); + std::set unknown; + for (const auto &cit : port.fieldValueMap) { const auto &field = cit.first; @@ -1029,6 +1032,11 @@ bool PortHelper::parsePortConfig(PortConfig &port) const } else { + if (unknown.find(field) != unknown.end()) + continue; // do not pollute logs with the same unknown field + + unknown.insert(field); + SWSS_LOG_WARN("Unknown field(%s): skipping ...", field.c_str()); } }