Changes between Version 2 and Version 3 of waue/2009/SEC_to_ICAS
- Timestamp:
- Aug 4, 2009, 5:43:44 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
waue/2009/SEC_to_ICAS
v2 v3 181 181 182 182 {{{ 183 #!java 183 184 public static class ICAS_M extends MapReduceBase implements 184 185 Mapper<LongWritable, Text, Text, Text> { … … 198 199 String source_ip = getip(str[11]); 199 200 String dest_ip = getip(str[12]); 200 String fkey = dest_ip ;201 String fkey = dest_ip + "<=" + str[3]; 201 202 202 203 String date = str[5] + "/" + str[6] + "/" + str[7] + "_" + str[8] 203 204 + ":" + str[9] + ":" + str[10]; 204 205 // source @ date @ sig @ class @ type 205 String fvalue = source_ip + "@" + date + "@" + str[3]+"@" +str[4]206 String fvalue = source_ip + "@" + date + "@" +"@" +str[4] 206 207 + "@"+ str[13]; 207 208 output.collect(new Text(fkey), new Text(fvalue)); … … 215 216 216 217 {{{ 218 #!java 217 219 public static class ICAS_R extends TableReduce<Text, Text> { 218 220 … … 236 238 // values.next().getByte() can get value and transfer to byte form, 237 239 while (values.hasNext()) { 238 // source_ip + "@" + date + "@" + sig + "@" +class + "@" + type;240 // source_ip + "@" + date + "@" + class + "@" + type; 239 241 rawstr = new String(values.next().getBytes()); 240 242 str = rawstr.split("@"); … … 248 250 // map.setTimestamp(timestamp); 249 251 map.put("infor:source_ip", Bytes.toBytes(source_ip)); 250 map.put("infor:signature", Bytes.toBytes(signature));251 252 map.put("infor:date", Bytes.toBytes(date)); 252 253 map.put("infor:class", Bytes.toBytes(sig_class));