def process_udp_frame(self,
                          id=None,
                          msg=None):
        """process_udp_frame

        Convert a complex nested json dictionary
        to a flattened dictionary and capture
        all unique keys for table construction

        :param id: key for this msg
        :param msg: udp frame for packet
        """

        # normalize into a dataframe
        df = json_normalize(msg)
        # convert to a flattened dictionary
        dt = json.loads(df.to_json())

        flat_msg = {}

        for k in dt:
            new_key = "udp_{}".format(k)
            flat_msg[new_key] = dt[k]["0"]
            if new_key not in self.udp_keys:
                self.udp_keys[new_key] = k
        # end of capturing all unique keys

        dt["udp_id"] = id
        self.all_udp.append(dt)

        log.debug("UDP data updated:")
        log.debug(self.udp_keys)
        log.debug(self.all_udp)
        log.debug("")

        return flat_msg
def process_udp_frame ( self , id = None , msg = None ) : df = json_normalize ( msg ) dt = json . loads ( df . to_json ( ) ) flat_msg = { } for k in dt : new_key = "udp_{}" . format ( k ) flat_msg [ new_key ] = dt [ k ] [ "0" ] if new_key not in self . udp_keys : self . udp_keys [ new_key ] = k dt [ "udp_id" ] = id self . all_udp . append ( dt ) log . debug ( "UDP data updated:" ) log . debug ( self . udp_keys ) log . debug ( self . all_udp ) log . debug ( "" ) return flat_msg
process_udp_frame

        Convert a complex nested json dictionary
        to a flattened dictionary and capture
        all unique keys for table construction

        :param id: key for this msg
        :param msg: udp frame for packet