Index: /sample/hadoop-0.16/test.java
===================================================================
--- /sample/hadoop-0.16/test.java	(revision 45)
+++ /sample/hadoop-0.16/test.java	(revision 46)
@@ -7,4 +7,5 @@
 import java.io.IOException;
 import java.io.RandomAccessFile;
+import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -252,9 +253,31 @@
 	}
 
-	void Date()throws Exception{
-		String da = "20/Jul/2008:08:26:55";
-		SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss",Locale.US);
+	void Date() throws Exception {
+		String da = "10/Jul/2008:08:26:55";
+		SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss",
+				Locale.US);
 		Date timestamp = sdf.parse(da);
+		long timeint = timestamp.getTime();
 		System.out.println(timestamp.toString());
+		System.out.println(timeint);
+	}
+
+	void getNowTime() {
+		SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
+		Date date = new Date();
+		String strDate = sdFormat.format(date);
+		System.out.println(strDate);
+		System.out.println(date.getTime());
+	}
+
+	void setTime() {
+		String str = "07/08:01:01:01";
+		SimpleDateFormat sdf = new SimpleDateFormat("dd/MM:HH:mm:ss",
+				Locale.TAIWAN);
+		Date tim = sdf.parse(str, new ParsePosition(0));
+		System.out.println(tim);
+		Long timestamp = tim.getTime();
+		System.out.println(timestamp);
+
 	}
 
@@ -278,5 +301,9 @@
 		// 測試 enum 列舉
 		// t.enumTest();
-		t.Date();
+		// 測試設定
+		// t.Date();
+		// 測試取得現在時間
+		// t.getNowTime();
+		t.setTime();
 	}
 
Index: /sample/hadoop-0.16/tw/org/nchc/code/SnortBase.java
===================================================================
--- /sample/hadoop-0.16/tw/org/nchc/code/SnortBase.java	(revision 45)
+++ /sample/hadoop-0.16/tw/org/nchc/code/SnortBase.java	(revision 46)
@@ -50,5 +50,8 @@
 import java.io.FileWriter;
 import java.io.IOException;
+import java.text.ParseException;
+import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.Locale;
 
@@ -72,7 +75,8 @@
 import org.apache.hadoop.mapred.Reporter;
 
+
 class Log {
 
-	public Log(String data) throws Exception {
+	public Log(String data)  {
 
 		String[] arr = data.split(";");
@@ -84,8 +88,7 @@
 		this.class_type = arr[4];
 		this.priority = arr[5];
-		// this.timestamp = "2008" + arr[6] + arr[7] + arr[8] + arr[9] +
-		// arr[10];
-		this.timestamp = getTime(arr[7] + "/" + arr[6] + "/2008:" + arr[8]
+		this.timestamp = getTime(arr[7] + "/" + arr[6] + ":" + arr[8]
 				+ ":" + arr[9] + ":" + arr[10]);
+//		this.timestamp = now.getTime();
 		this.source = arr[11];
 		this.destination = arr[12];
@@ -98,5 +101,5 @@
 
 	}
-
+	Date now = new Date(); 
 	long timestamp;
 
@@ -107,8 +110,8 @@
 	String source, destination, type, ttl, tos, id, iplen, dgmlen;
 
-	long getTime(String str) throws Exception {
-		SimpleDateFormat sdf = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss",
+	long getTime(String str) {
+		SimpleDateFormat sdf = new SimpleDateFormat("dd/MM:HH:mm:ss",
 				Locale.TAIWAN);
-		Long timestamp = sdf.parse(str).getTime();
+		Long timestamp = sdf.parse(str,new ParsePosition(0)).getTime();
 		return timestamp;
 	}
@@ -121,5 +124,5 @@
 	public static final String TABLE = "table.name";
 
-	static String tableName = "mySnort";
+	static String tableName = "SnortBase";
 
 	static HTable table = null;
@@ -140,7 +143,7 @@
 		public void map(WritableComparable key, Text value,
 				OutputCollector<Text, Writable> output, Reporter reporter)
-				throws IOException {
-
-			try {
+				throws IOException{
+
+//			try {
 
 				Log log = new Log(value.toString());
@@ -181,7 +184,7 @@
 				table.commit(lockId, log.timestamp);
 
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
+//			} catch (Exception e) {
+//				e.printStackTrace();
+//			}
 
 		}
@@ -200,5 +203,5 @@
 	}
 
-	public static void runMapReduce(String table, String inpath)
+	public static void runMapReduce(String tableName, String inpath)
 			throws IOException {
 		Path tempDir = new Path("/tmp/Mylog/");
@@ -207,5 +210,5 @@
 		JobConf jobConf = new JobConf(conf, SnortBase.class);
 		jobConf.setJobName("Snort Parse");
-		jobConf.set(TABLE, table);
+		jobConf.set(TABLE, tableName);
 		// 先省略 自動搜尋目錄的功能
 		/*
@@ -224,4 +227,5 @@
 		jobConf.setNumMapTasks(cluster.getMapTasks());
 		jobConf.setNumReduceTasks(0);
+		fs.delete(tempDir);
 		JobClient.runJob(jobConf);
 		fs.delete(tempDir);
@@ -248,5 +252,5 @@
 
 	public static void main(String[] args) throws IOException, Exception {
-		String table_name = "snort";
+
 		String path = "/user/waue/alert_meta";
 
@@ -256,7 +260,7 @@
 		 * SnortParser("/tmp/alert","/tmp/alert_SnortBase"); sp.parseToLine();
 		 */
-		creatTable(table_name);
-
-		runMapReduce(table_name, path);
+		creatTable(tableName);
+
+		runMapReduce(tableName, path);
 
 	}
