Cast 'http_status' field into an integer
diff --git a/heka/files/lua/common/contrail_patterns.lua b/heka/files/lua/common/contrail_patterns.lua
index 3383a3b..9499875 100644
--- a/heka/files/lua/common/contrail_patterns.lua
+++ b/heka/files/lua/common/contrail_patterns.lua
@@ -37,7 +37,7 @@
 -- Common patterns
 local modulename =  l.Cg(pgname, "Module")
 local ip_address = l.Cg((l.digit + patt.dot)^1, "ip_address")
-local http_status = l.Cg(patt.Number, "status")
+local http_status = l.Cg(patt.Number / tonumber, "status")
 local http_request_time = l.Cg(patt.Number, "request_time")
 local delim = (patt.sp + patt.dash)^1
 local hostname = l.Cg(patt.programname, "Hostname")
diff --git a/heka/files/lua/common/patterns.lua b/heka/files/lua/common/patterns.lua
index 09be695..be43d08 100644
--- a/heka/files/lua/common/patterns.lua
+++ b/heka/files/lua/common/patterns.lua
@@ -121,7 +121,7 @@
 -- TODO(pasquier-s): build the LPEG grammar based on the log_format parameter
 -- passed to eventlet.wsgi.server similar to what the build_rsyslog_grammar
 -- function does for RSyslog.
-local openstack_http_status = l.P"status: "^-1 * l.Cg(l.digit^3, "http_status")
+local openstack_http_status = l.P"status: "^-1 * l.Cg(l.digit^3 / tonumber, "http_status")
 local openstack_response_size = l.P"len: "^-1 * l.Cg(l.digit^1 / tonumber, "http_response_size")
 local openstack_response_time = l.P"time: "^-1 * l.Cg(l.digit^1 * dot^0 * l.digit^0 / tonumber, "http_response_time")
 
diff --git a/tests/lua/test_patterns.lua b/tests/lua/test_patterns.lua
index 86d9507..d15b49d 100644
--- a/tests/lua/test_patterns.lua
+++ b/tests/lua/test_patterns.lua
@@ -87,12 +87,12 @@
         assertEquals(patt.openstack_http:match(
             '"OPTIONS / HTTP/1.0" status: 200 len: 497 time: 0.0006731'),
             {http_method = 'OPTIONS', http_url = '/', http_version = '1.0',
-             http_status = '200', http_response_size = 497,
+             http_status = 200, http_response_size = 497,
              http_response_time = 0.0006731})
         assertEquals(patt.openstack_http:match(
             'foo "OPTIONS / HTTP/1.0" status: 200 len: 497 time: 0.0006731 bar'),
             {http_method = 'OPTIONS', http_url = '/', http_version = '1.0',
-             http_status = '200', http_response_size = 497,
+             http_status = 200, http_response_size = 497,
              http_response_time = 0.0006731})
     end
 
@@ -100,12 +100,12 @@
         assertEquals(patt.openstack_http:match(
             '"OPTIONS / HTTP/1.0" status: 200  len: 497 time: 0.0006731'),
             {http_method = 'OPTIONS', http_url = '/', http_version = '1.0',
-             http_status = '200', http_response_size = 497,
+             http_status = 200, http_response_size = 497,
              http_response_time = 0.0006731})
         assertEquals(patt.openstack_http:match(
             'foo "OPTIONS / HTTP/1.0" status: 200  len: 497 time: 0.0006731 bar'),
             {http_method = 'OPTIONS', http_url = '/', http_version = '1.0',
-             http_status = '200', http_response_size = 497,
+             http_status = 200, http_response_size = 497,
              http_response_time = 0.0006731})
     end