/*
 * Apache HTTPD logparsing made easy
 * Copyright (C) 2011-2015 Niels Basjes
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package nl.basjes.parse;

import java.text.ParseException;

import nl.basjes.parse.apachehttpdlog.ApacheHttpdLoglineParser;
import nl.basjes.parse.core.Casts;

public class OmnitureLogLineParser<RECORD> extends ApacheHttpdLoglineParser<RECORD> {

    public OmnitureLogLineParser(Class<RECORD> clazz, String logformat)
        throws ParseException {
        super(clazz, logformat);

        addTypeRemapping("request.firstline.uri.query.g", "HTTP.URI", Casts.STRING_ONLY);
        addTypeRemapping("request.firstline.uri.query.r", "HTTP.URI", Casts.STRING_ONLY);
    }
}

@@ -881,16 +881,73 @@
 e.Casts;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Apublic
@@ -1027,16 +1027,88 @@
 ORD%3E %7B%0A%0A
+    Logger LOG = LoggerFactory.getLogger(OmnitureLogLineParser.class);%0A%0A
     publ
@@ -1203,16 +1203,16 @@
 ption %7B%0A
-
         
@@ -1233,24 +1233,530 @@
 ogformat);%0A%0A
+        String deprecation = %22 ---------- %5BDEPRECATED%5D %22;%0A        LOG.warn(%22%5Cn%22 +%0A                deprecation + %22%5Cn%22 +%0A                deprecation + %22The Omniture specific parser has been deprecated.%5Cn%22 +%0A                deprecation + %22Use the normal Apache parser in conjunction with these two mappings:%5Cn%22 +%0A                deprecation + %22    request.firstline.uri.query.g ==%3E HTTP.URI%5Cn%22+%0A                deprecation + %22    request.firstline.uri.query.r ==%3E HTTP.URI%5Cn%22+%0A                deprecation );%0A%0A
         addT

Add deprecation warning about the Omniture specific parser