import re


def _GetFieldFromOutput(prefix, output, default=''):
  """Search output for line of the form 'Foo: Bar', return 'Bar'."""
  field_re = re.compile(prefix + r'\s*(\S+)')
  for line in output.splitlines():
    result = field_re.search(line)
    if result is not None:
      return result.group(1).strip()
  return default