<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    paulwong

    CombinedLogLoader

    PIG中的LOAD函數,可以在LOAD數據的同時,進行正則表達式的篩選。

    /*
     * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the
     * NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF
     * licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file
     * except in compliance with the License. You may obtain a copy of the License at
     * 
     * 
    http://www.apache.org/licenses/LICENSE-2.0
     * 
     * Unless required by applicable law or agreed to in writing, software distributed under the License is
     * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and limitations under the License.
     
    */

    package org.apache.pig.piggybank.storage.apachelog;

    import java.util.regex.Pattern;

    import org.apache.pig.piggybank.storage.RegExLoader;

    /**
     * CombinedLogLoader is used to load logs based on Apache's combined log format, based on a format like
     * 
     * LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
     * 
     * The log filename ends up being access_log from a line like
     * 
     * CustomLog logs/combined_log combined
     * 
     * Example:
     * 
     * raw = LOAD 'combined_log' USING org.apache.pig.piggybank.storage.apachelog.CombinedLogLoader AS
     * (remoteAddr, remoteLogname, user, time, method, uri, proto, status, bytes, referer, userAgent);
     * 
     
    */

    public class CombinedLogLoader extends RegExLoader {
        // 1.2.3.4 - - [30/Sep/2008:15:07:53 -0400] "GET / HTTP/1.1" 200 3190 "-"
        
    // "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1"
        private final static Pattern combinedLogPattern = Pattern
            .compile("^(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+.(\\S+\\s+\\S+).\\s+\"(\\S+)\\s+(.+?)\\s+(HTTP[^\"]+)\"\\s+(\\S+)\\s+(\\S+)\\s+\"([^\"]*)\"\\s+\"(.*)\"$");

        public Pattern getPattern() {
            return combinedLogPattern;
        }
    }

    posted on 2013-04-08 11:28 paulwong 閱讀(282) 評論(0)  編輯  收藏 所屬分類: PIG

    主站蜘蛛池模板: 亚洲精品V天堂中文字幕| 亚洲自偷自偷图片| 免费的一级片网站| 国产亚洲精品无码专区| 亚洲成人国产精品| 久久久久久影院久久久久免费精品国产小说 | 久久免费国产精品| 中国性猛交xxxxx免费看| 亚洲日韩精品无码专区| 亚洲精品午夜国产va久久| 亚洲精品成人无码中文毛片不卡| 免费99精品国产自在现线| 一个人在线观看视频免费| 国产99视频精品免费专区| 午夜不卡AV免费| 黄色一级免费网站| A级毛片成人网站免费看| 国产免费无码AV片在线观看不卡 | 国产亚洲综合久久系列| 亚洲国产精华液网站w| 亚洲麻豆精品果冻传媒| 亚洲日韩国产精品无码av| 亚洲国产一成人久久精品| 亚洲小视频在线观看| 在线观看亚洲精品福利片| 亚洲国产精品无码专区影院| 亚洲系列国产精品制服丝袜第| 亚洲国产美女精品久久久久| 亚洲日韩av无码中文| 暖暖免费中文在线日本| 久久国产精品国产自线拍免费| 亚洲一区二区三区免费观看| 高清国语自产拍免费视频国产 | 无码区日韩特区永久免费系列| 免费无码又爽又刺激高潮| 亚洲国产精品国产自在在线| 亚洲成AV人在线播放无码| 亚洲综合偷自成人网第页色| 亚洲国产成人精品久久| 亚洲最新在线视频| 黄色一级视频免费|