Tshark -d option to format date doesn't work with -T fields
Tshark's driving me mad! I want to parse a trace and output as csv with headers and I want the date format in UTC. Instead I always get the long format like "May 20, 2020 17:34:23.241938000 Eastern Daylight Time".
My current attempt is using the following, which according to link:this post can be done with -t ud, but it doesn't affect the output. For instance:
tshark -r in.pcap -Y frame.number==1 -E header=y -E separator=',' -t ud -T fields -e frame.time
I also explored the -o gui.column.format option (which is tricky to get working in powershell, but I did). I was able to format the date properly using that method, but I didn't see a way to add comma separators or headers.
My long term goal is to dump TCP parameters so that I can import into Splunk and design charts to understand slow uploads and TCP congestion. Wireshark takes to long to chart and crashes frequently. And some a previously mentioned tool like TCP trace is archaic stating that maybe it'll work on Win2000 :) Splunk integration would also be nice because I could correlate with other log data that is already imported.
Doesn't anybody know why -d option doesn't work?
Thanks -Paul
Have you tried with the field
_ws.col.Time?$ tshark -r ./stream-0.pcap -T fields -e _ws.col.Time -e frame.number -e frame.time -Eheader=y -Eseparator="/t" -Equote=d -c 2 -t ad _ws.col.Time frame.number frame.time "2014-01-21 05:28:16.588384" "1" "Jan 21, 2014 05:28:16.588384000 Central Standard Time" "2014-01-21 05:28:16.603260" "2" "Jan 21, 2014 05:28:16.603260000 Central Standard Time" $ tshark -r ./stream-0.pcap -T fields -e _ws.col.Time -e frame.number -e frame.time -Eheader=y -Eseparator="/t" -Equote=d -c 2 -t ud _ws.col.Time frame.number frame.time "2014-01-21 11:28:16.588384" "1" "Jan 21, 2014 05:28:16.588384000 Central Standard Time" "2014-01-21 11:28:16.603260" "2" "Jan 21, 2014 05:28:16.603260000 Central Standard Time"Yes, that does work! How is that different than frame.time?
If you look in the Wireshark
preferencesfile there is a section that defines the GUI columns:_ws.col.Timeis displaying theTimecolumn.Format strings for columns here or you can look in the Gui.
Right click the column header for
Timeand selectEdit Column.The default is
Time (format as specified)which the-tsets.gui.time_formatis stored inrecentwhichtsharkdoesn't use.(No need to look at source for column types -
$ tshark -G column-formats)