Changeset 31 for sample/hadoop-0.16/tw/org/nchc/demo
- Timestamp:
- Jul 17, 2008, 3:35:18 PM (16 years ago)
- Location:
- sample/hadoop-0.16/tw/org/nchc/demo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/hadoop-0.16/tw/org/nchc/demo/LogFetcher.java
r29 r31 6 6 */ 7 7 /** 8 * Copyright 2007 The Apache Software Foundation 9 * 10 * Licensed to the Apache Software Foundation (ASF) under one 11 * or more contributor license agreements. See the NOTICE file 12 * distributed with this work for additional information 13 * regarding copyright ownership. The ASF licenses this file 14 * to you under the Apache License, Version 2.0 (the 15 * "License"); you may not use this file except in compliance 16 * with the License. You may obtain a copy of the License at 17 * 18 * http://www.apache.org/licenses/LICENSE-2.0 19 * 20 * Unless required by applicable law or agreed to in writing, software 21 * distributed under the License is distributed on an "AS IS" BASIS, 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 * See the License for the specific language governing permissions and 24 * limitations under the License. 8 * Purpose : 9 * This program will parse your apache log and store it into Hbase. 10 * 11 * HowToUse : 12 * Make sure two thing : 13 * 1. Upload apache logs ( /var/log/apache2/access.log* ) to \ 14 * hdfs (default: /user/waue/apache-log) \ 15 * $ bin/hadoop dfs -put /var/log/apache2/ apache-log 16 * 2. parameter "dir" in main contains the logs. 17 * 3. you should filter the exception contents manually, \ 18 * ex: ::1 - - [29/Jun/2008:07:35:15 +0800] "GET / HTTP/1.0" 200 729 "... 19 * 20 * Check Result: 21 * Go to hbase console, type : 22 * hql > select * from apache-log; 23 24 +-------------------------+-------------------------+-------------------------+ 25 | Row | Column | Cell | 26 +-------------------------+-------------------------+-------------------------+ 27 | 118.170.101.250 | http:agent | Mozilla/4.0 (compatible;| 28 | | | MSIE 4.01; Windows 95) | 29 +-------------------------+-------------------------+-------------------------+ 30 | 118.170.101.250 | http:bytesize | 318 | 31 +-------------------------+-------------------------+-------------------------+ 32 ..........(skip)........ 33 +-------------------------+-------------------------+-------------------------+ 34 | 87.65.93.58 | http:method | OPTIONS | 35 +-------------------------+-------------------------+-------------------------+ 36 | 87.65.93.58 | http:protocol | HTTP/1.1 | 37 +-------------------------+-------------------------+-------------------------+ 38 | 87.65.93.58 | referrer:- | * | 39 +-------------------------+-------------------------+-------------------------+ 40 | 87.65.93.58 | url:* | - | 41 +-------------------------+-------------------------+-------------------------+ 42 31 row(s) in set. (0.58 sec) 43 25 44 */ 45 46 26 47 package tw.org.nchc.demo; 27 48
Note: See TracChangeset
for help on using the changeset viewer.