public static String extractChildJobId(String line) {
    for (Pattern p : ID_PATTERNS) {
      Matcher m = p.matcher(line);
      if (m.find())
        return m.group(1);
    }

    return null;
  }
Extract the job id from jar jobs.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonUtils.java