Ignore:
Timestamp:
Jul 23, 2008, 5:08:53 PM (16 years ago)
Author:
waue
Message:

HBaseRecordPro.java -> only modified for debuging SnortUploadHbase?.java

SnortParser?.java -> catch a bug and fix it

SnortUploadHbase?.java -> it can run finally ..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sample/hadoop-0.16/tw/org/nchc/code/SnortParser.java

    r33 r43  
    33 * Editor: Waue Chen
    44 * From :  NCHC. Taiwn
    5  * Last Update Date: 07/17/2008
     5 * Last Update Date: 07/23/2008
    66 */
    77
     
    4343    case 1:
    4444      patten_line = Pattern
    45           .compile("^\\[\\**\\] \\[([1-9]*):([1-9]*):([1-9]*)\\] ([^\\[]*)\\[\\**\\]$");
     45          .compile("^\\[\\**\\] \\[([0-9]*):([0-9]*):([0-9]*)\\] ([^\\[]*)\\[\\**\\]$");
    4646      break;
    4747    case 2:
     
    8080    int count = 0;
    8181    do {
    82       String tmp = fi.readLine();
    83       if (tmp == null) {
     82      line = fi.readLine();
     83      if (line == null) {
    8484        break;
    85       } else if (count < 4) {
    86         line = tmp;
     85      }else if(line.isEmpty()){
     86        fw.write(this.logData.toString() + "\n");
     87        this.logData = "";
     88        count = 0;       
     89      }else if (count < 4) {
    8790        // System.out.println(line);
    8891        snortParser(line, count + 1);
    8992        count++;
    90       } else if (count == 4) {
     93      } else {
    9194        count++;
    92       } else if (count == 5) {
    93         fw.write(this.logData.toString() + "\n");
    94         this.logData = "";
    95         count = 0;
    96       } else {
    97         System.err.print(" Error ! ");
    98         return;
    9995      }
    10096    } while (true);
     
    105101
    106102  public static void main(String[] args) throws ParseException, Exception {
    107     String in = new String("/home/waue/Desktop/alert");
    108     String ou = new String("/home/waue/Desktop/bb");
     103    String in = new String("/home/waue/Desktop/alert_m");
     104    String ou = new String("/tmp/alert_my");
    109105    SnortParser a = new SnortParser(in, ou);
    110106    a.parseToLine();
Note: See TracChangeset for help on using the changeset viewer.