@Test
/** Test a common case where regex is used to parse apache log format. */
public void testApacheRegex() throws Exception {
RegexHbaseEventSerializer s = new RegexHbaseEventSerializer();
Context context = new Context();
context.put(RegexHbaseEventSerializer.REGEX_CONFIG,
"([^ ]*) ([^ ]*) ([^ ]*) (-|\\[[^\\]]*\\]) \"([^ ]+) ([^ ]+)" +
" ([^\"]+)\" (-|[0-9]*) (-|[0-9]*)(?: ([^ \"]*|\"[^\"]*\")" +
" ([^ \"]*|\"[^\"]*\"))?");
context.put(RegexHbaseEventSerializer.COL_NAME_CONFIG,
"host,identity,user,time,method,request,protocol,status,size," +
"referer,agent");
s.configure(context);
String logMsg = "33.22.11.00 - - [20/May/2011:07:01:19 +0000] " +
"\"GET /wp-admin/css/install.css HTTP/1.0\" 200 813 " +