[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [metrics-utils/master 4/4] Don't break if first column doesn't contain IPv4 address.



Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Fri, 24 Sep 2010 18:02:52 +0200
Subject: Don't break if first column doesn't contain IPv4 address.
Commit: 708966314e744d48a7720b08e94e21f04cf08b23

---
 visitor/ChangeLog    |    2 ++
 visitor/VisiTor.java |    5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/visitor/ChangeLog b/visitor/ChangeLog
index e187b30..80626e8 100644
--- a/visitor/ChangeLog
+++ b/visitor/ChangeLog
@@ -4,6 +4,8 @@ Changes in version 0.0.3 - 2010-09-2?
   - Support parsing .gz-compressed web server logs. Suggested by murb.
   - Support reading decompressed web server log from stdin. Suggested by
     murb.
+  - Don't break if first column doesn't contain IPv4 address. Spotted by
+    murb.
 
 Changes in version 0.0.2 - 2010-09-22
   - Don't break if we're given zero exit lists.
diff --git a/visitor/VisiTor.java b/visitor/VisiTor.java
index 2a9fb1e..2cde49a 100644
--- a/visitor/VisiTor.java
+++ b/visitor/VisiTor.java
@@ -93,9 +93,8 @@ public final class VisiTor {
       return;
     }
     if (!ipAddressPattern.matcher(logLine.split(" ")[0]).matches()) {
-      System.out.println("FAILED\nFirst column does not contain IP "
-          + "address! Exiting!");
-      return;
+      System.out.print("WARN\nFirst column may not contain IP address! "
+          + "Trying to parse anyway... ");
     }
     try {
       logFormat.parse(logLine.split(" ")[3] + " "
-- 
1.7.1