def METHOD_NAME(self, username: str, config_id: int, config: Dict) -> int:
    """更新日志采集规则"""
    meta_data = LogCollectMetadata.objects.get(
        config_id=config_id, project_id=self.project_id, cluster_id=self.cluster_id
    )
    builder = get_builder_class(meta_data.log_source_type).from_dict(config)
    data = self.client.update_collect_config(config_id=config_id, config=builder.build_update_config())
    meta_data.updator = username
    meta_data.save(update_fields=['updator', 'updated'])
    LogIndexSet.safe_create(project_id=self.project_id, bk_biz_id=builder.bk_biz_id, **data)
    return config_id