def get_service(conn): dst_port = conn.dst_port proto = conn.proto try: return ' ({}) '.format(getservbyport(int(dst_port), proto)) except: return ''