def get_jsonpath_val(json_obj, path_str):
    """Get json attribute value from a path.

  Args:
    json_obj: json object.
    path_str: attribute path as key1.key2.key3
  Returns:
    value of the given path, if not valid, return None.
  """
    keys = path_str.split('.')
    cur_val = None
    for cur_key in keys:
        if cur_key in json_obj:
            cur_val = json_obj[cur_key]
        else:
            cur_val = None
            break
    return cur_val
