private String getQueryId(RowSet rowSetLog) {
    Iterator<Object[]> iter = rowSetLog.iterator();
    // non-verbose pattern is %-5p : %m%n. Look for " : "
    while (iter.hasNext()) {
      String row = iter.next()[0].toString();
      Assert.assertEquals(true, row.matches("^.*(FATAL|ERROR|WARN|INFO|DEBUG|TRACE).*$"));

      // look for a row like "INFO  : Query ID = asherman_20170718154720_17c7d18b-36e6-4b35-a8e2-f50847db58ae"
      String queryIdLoggingProbe = "INFO  : Query ID = ";
      int index = row.indexOf(queryIdLoggingProbe);
      if (index >= 0) {
        return row.substring(queryIdLoggingProbe.length()).trim();
      }
    }
    return null;
  }
Open a session, and create a table for cases usage

@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/service/cli/operation/TestOperationLoggingLayout.java