To avoid the need for recompiling Wireshark, you could consider implementing a Lua post-dissector that reformats the frame.time
field however you like. Below is one such Lua post-dissector that you may find useful. To use it, you will need to save it in your Wireshark plugins directory or explicitly specify to use it on the tshark command line.
local framepost = Proto("framepost", "frame post-dissector")
local pf = {
ft = ProtoField.string("framepost.time", "Arrival Time")
}
-- Register protocol fields
framepost.fields = pf
local ft = Field.new("frame.time")
local function mon2num(mon)
local mons = {
["Jan"] = 1, ["Feb"] = 2, ["Mar"] = 3, ["Apr"] = 4, ["May"] = 5, ["Jun"] = 6,
["Jul"] = 7, ["Aug"] = 8, ["Sep"] = 9, ["Oct"] = 10, ["Nov"] = 11, ["Dec"] = 12
}
return mons[mon]
end
function framepost.dissector(tvbuf, pinfo, tree)
local ft_ex = ft()
if ft_ex ~= nil then
local framepost_tree = tree:add(framepost, "Frame Postdissector")
local ft = ft_ex.display:gsub('(%a+)%s+(%d+),%s+(%d+)(.)',
function(m, d, y, t)
return y .. "-" .. ("%02d"):format(mon2num(m)) .. "-" .. ("%02d"):format(d) .. t
end)
framepost_tree:add(pf.ft, ft)
end
end
register_postdissector(framepost)
Example Usage:
tshark -r 0001.pcap -X lua_script:framepost.lua -T fields -e framepost.time -e ip.src -e ip.dst
Is it similar to this question ?
Will
_ws.col.Time
work for you?Hi Folks, sorry to ask such a stupid question regarding this topic. I basically have the same topic as the threadstarter, but with a small difference. If i use the command "_ws.col.Time" on my linux system, no output is written in my .txt file. If i use frame.time, the output in the format frome above will be saved...
I also retried the same command line on my windows systems; there it works fine with "_ws.col.Time"...
Im totally confused why this behavior stucks on my Linux system (which is preferred to be used for decoding).
Best regards Julius
Are you using the same version (
tshark -v
) and same profile on both systems?(see 11.6. Configuration Profiles for Export/Import)
@Julius, please ask a separate question rather than piggy-backing on this one. Your question is not the same as the original question posed here and any answer will be different as well.