private LogItemParser parseComplexParser() throws XMLStreamException{
        int event = reader.next();
        LogItemParser parser = null;
        LogParserBuilder builder = new LogParserBuilder();
        while (!foundItemEnd(event, "complex")){
            if (event == XMLStreamConstants.START_ELEMENT){
                String elemName = reader.getLocalName();
                if ("simplesplittokenizer".equals(elemName)){
                    //split tokenizer
                    String splitStr = reader.getAttributeValue(null, "splitStr");
                    String start = reader.getAttributeValue(null, "start");
                    String stop = reader.getAttributeValue(null, "stop");
                    if (splitStr != null){
                        builder.withSimpleSplitTokenizer(splitStr);
                    }else {
                        builder.withSimpleSplitTokenizer(start, stop);
                    }
                }else if ("dateindexfinder".equals(elemName)){
                    String pattern = reader.getAttributeValue(null, "pattern");
                    String pos = reader.getAttributeValue(null, "position");
                    if (pos != null){
                        builder.withDateFinder(pattern,Integer.parseInt(pos));
                    }else {
                        builder.withDateFinder(pattern);
                    }
                }else if ("maplinebuilder".equals(elemName)){
                    List<String> keys = parseKeys();
                    builder.withDateMapBuilder(keys);
                }
            }
            
            event = reader.next();
        }
        parser = builder.build();
        logItemClass = MapLogLine.class;
        if (parser == null){
            throw new XMLStreamException("Did not find a complete complex parser element");
        }
        return parser;
    }