f = flow.get()
ts = f:timestring_legacy()
ipver, srcip, dstip, proto, sp, dp = f:tuple()
- data, data_open, data_close = SCStreamingBuffer()
- logger.notice("called with data_open " .. tostring(data_open) .. " data_close " .. tostring(data_close));
+ local stream = args["stream"]
+ logger.notice("called with data_open " .. tostring(stream["open"]) .. " data_close " .. tostring(stream["close"]) .. " to_server " .. tostring(stream["to_server"]) .. " to_client " .. tostring(stream["to_client"]));
filename = filepath .. "/http-" .. proto .. "-" .. srcip .. "-" .. dstip .. "-" .. sp .. "-" .. dp
file_mode = "a"
end
file = assert(io.open(filename, file_mode))
- file:write (data)
+ file:write (stream["data"])
file:flush()
file.close(file)
end
f = flow.get()
ts = f:timestring_legacy()
ipver, srcip, dstip, proto, sp, dp = f:tuple()
- data, data_open, data_close = SCStreamingBuffer()
+ local stream = args["stream"]
filename = filepath .. "/" .. proto .. "-" .. srcip .. "-" .. dstip .. "-" .. sp .. "-" .. dp
file_mode = "a"
- if (data_open == true) then
+ if (stream["open"] == true) then
file_mode = "w"
end
file = assert(io.open(filename, file_mode))
- file:write (data)
+ file:write (stream["data"])
file:flush()
file.close(file)
end