]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
output-lua: fix lua script
authorJason Ish <ish@unx.ca>
Wed, 20 Sep 2017 09:02:38 +0000 (10:02 +0100)
committerJason Ish <ish@unx.ca>
Wed, 20 Sep 2017 09:02:38 +0000 (10:02 +0100)
On some distros it was correct, others it failed. I think this was
due to a type in string.gsub, using %g instead of %c.

output-lua/expected/http_lua.log
output-lua/http.lua

index 16396bc6b2637cd147453598fae3906180e86021..9a531a6401960e28cad87349b7f19ba32e1b3306 100644 (file)
@@ -1 +1 @@
-10/06/2015-15:16:43.137833 codemonkey.net [**] /base64-hello-world.txt [**] ........... [**] 10.16.1.11:59733.0 -> 104.131.202.103:80.0
+10/06/2015-15:16:43.137833 codemonkey.net [**] /base64-hello-world.txt [**] curl/7.40.0 [**] 10.16.1.11:59733.0 -> 104.131.202.103:80.0
index 48974cb9389afef787463fced167ea93445e868b..4b8cdb6a3ab776a7f1f5ced1a9ce18e6c2f48016 100644 (file)
@@ -31,7 +31,7 @@ function log(args)
     if http_ua == nil then
         http_ua = "<useragent unknown>"
     end
-    http_ua = string.gsub(http_ua, "%g", ".")
+    http_ua = string.gsub(http_ua, "%c", ".")
 
     ts = SCPacketTimeString()
     ipver, srcip, dstip, proto, sp, dp = SCFlowTuple()