The problem apparently lies in the data type returned by the extractor()
functions. In order to compare them with another value in the if statement they have to be converted into strings using tostring()
function.
For example:
if (not (tostring(udp_port) == "3000" or tostring(udp_port)=="3838" or flag==1))