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

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

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

    paulwong

    CombinedLogLoader

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

    /*
     * 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 閱讀(285) 評論(0)  編輯  收藏 所屬分類: PIG

    主站蜘蛛池模板: 亚洲国产日韩a在线播放| 免费福利视频导航| 人成午夜免费大片在线观看| 日产乱码一卡二卡三免费| 一级毛片在线播放免费| 国产成人高清亚洲一区91| 久久亚洲精品无码av| 亚洲AV成人无码网站| 国产尤物在线视精品在亚洲| 国产精品自拍亚洲| 羞羞视频免费网站日本| 一区二区三区免费电影| aaa毛片免费观看| a级在线观看免费| 成人黄网站片免费视频 | 曰批全过程免费视频在线观看| 人妖系列免费网站观看| 亚洲阿v天堂在线2017免费| 福利免费在线观看| 黄页免费在线观看| 在线观看永久免费| 嫩草成人永久免费观看| 无遮挡呻吟娇喘视频免费播放| 男人免费视频一区二区在线观看| 五月婷婷免费视频| 午夜精品一区二区三区免费视频 | 久久国产亚洲精品麻豆| 免费a级毛片高清视频不卡 | 成人精品视频99在线观看免费| a级毛片毛片免费观看久潮喷 | 小说区亚洲自拍另类| sss在线观看免费高清| 久久免费精品视频| 国产精品爱啪在线线免费观看| 亚洲午夜免费视频| 麻豆一区二区免费播放网站| 国产成人啪精品视频免费网| 久久经典免费视频| 免费大香伊蕉在人线国产| 久久久久成人片免费观看蜜芽| 久久99九九国产免费看小说|