private static synchronized String statusAsJson(
        String stage,
        long totalProcessed,
        long consumedSinceLastRebalanced,
        long remaining,
        String transactionalId
    ) {
        Map<String, Object> statusData = new LinkedHashMap<>();
        statusData.put("transactionalId", transactionalId);
        statusData.put("stage", stage);
        statusData.put("time", FORMAT.format(new Date()));
        statusData.put("totalProcessed", totalProcessed);
        statusData.put("consumed", consumedSinceLastRebalanced);
        statusData.put("remaining", remaining);
        return toJsonString(statusData);
    }
Get the command-line argument parser.
tools/src/main/java/org/apache/kafka/tools/TransactionalMessageCopier.java