title: regex for access log in hive serde
body: <p>I want to extract out (ip, requestUrl, timeStamp) from the access logs to load to hive database. One line from access log is as follows.</p>
  
  <p><pre><code>
  66.249.68.6 - - [14/Jan/2012:06:25:03 -0800] "GET /example.com HTTP/1.1" 200 708 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
  </pre></code></p>
  
  <p>I tried with following and several variations of regex without any success. (The loaded table is with all NULL values indicating the regex doesn't match the input).</p>
  
  <p><pre><code>
  CREATE TABLE access_log (
    remote_ip STRING,
    request_date STRING,
    method STRING,
    request STRING,
    protocol STRING
  )
  ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
  WITH SERDEPROPERTIES  (
  "input.regex" = "([^ ]<em>) . . [([^]]+)] \"([^ ]</em>) ([^ ]<em>) ([^ \"]</em>)\" *",
  "output.format.string" = "%1$s %2$s %3$s %4$s %5$s"
  )
  STORED AS TEXTFILE;
  </pre></code></p>
  
  <p>I am not very experienced with regex. Can anybody help me with this?</p>