@Override
    public List<LogItem> parse(
            ClsSinkContext context,
            ProfileEvent event,
            TransformProcessor<String, Map<String, Object>> processor) {
        String uid = event.getUid();
        ClsIdConfig idConfig = context.getIdConfig(uid);
        if (idConfig == null) {
            LOG.error("There is no cls id config for uid {}, discard it", uid);
            context.addSendResultMetric(event, context.getTaskName(), false, System.currentTimeMillis());
            return null;
        }

        // prepare values
        String stringValues = this.getStringValues(event, idConfig);
        Map<String, Object> extParams = new ConcurrentHashMap<>();
        event.getHeaders().forEach((k, v) -> extParams.put(k, v));
        List<Map<String, Object>> resultList = processor.transform(stringValues, extParams);
        if (resultList == null) {
            context.addSendFilterMetric(event, context.getTaskName());
            return null;
        }
        List<LogItem> itemList = new ArrayList<>();
        for (Map<String, Object> result : resultList) {
            // prepare keys
            List<String> listKeys = idConfig.getFieldList();
            final List<String> listValues = new ArrayList<>(listKeys.size());
            listKeys.forEach(v -> listValues.add(String.valueOf(result.get(v))));
            listValues.forEach(value -> this.truncateSingleValue(value, context.getKeywordMaxLength()));
            // prepare offset
            int fieldOffset = idConfig.getFieldOffset();
            // convert to LogItem format
            LogItem item = this.parseToLogItem(listKeys, listValues, event.getRawLogTime(), fieldOffset);
            // add ftime
            String ftime = dateFormat.format(new Date(event.getRawLogTime()));
            item.PushBack("ftime", ftime);
            // add extinfo
            String extinfo = this.getExtInfo(event);
            item.PushBack("extinfo", extinfo);
            itemList.add(item);
        }
        return itemList;
    }
Parse event to {@literal List<LogItem>} format.

@param context Context of CLS sink.
@param event Event to be pares to {@literal List<LogItem>}
@return Prepared data structure to send.
inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/sink/cls/DefaultEvent2LogItemHandler.java