Hi, in Wireshark 1.10.5 on Windows I can select View | Time Display Format | Date and Time of Day and date is displayed in ISO date format e.g. "2014-02-25 13:20:11 740751000" How to display the same format in tshark? I tried:
but the output is : "Feb 25, 2014 13:20:11.740751000" How to display ISO date format in tshark? Thanks asked 04 Mar '14, 05:18 dolphin500 edited 04 Mar '14, 05:22 |
3 Answers:
In that case, I'd suggest the following:
answered 04 Mar '14, 11:10 cmaynard ♦♦ showing 5 of 9 show 4 more comments |
You can do this by specifying the time column format using something such as:
If you're using a recent enough version of Wireshark (anything post-r52627) then you can find all the column format options by running, " answered 04 Mar '14, 07:52 cmaynard ♦♦ @cmaynard, your command works fine for the sample you have provided:
but in output I would like to only specify the columns that I really need like for example:
How to display ISO-date format if only columns I need should be displayed and header and column separator is required? P.S. Command Thanks (04 Mar '14, 09:04) dolphin500 Info from: http://ask.wireshark.org/questions/29000/windows-7-problem-tshark and I so far I come to this command:
but still I don't get the same output like I would like to have. Like headers and column separator. So above command outputs:
but I would like to have (my command from previous post with -T and -e option):
but second column date in ISO-format. (04 Mar '14, 09:43) dolphin500 |
tshark -u s -t ad -o column.format:"Time, %t","Source, %s","Destination, %d","Protocol, %p","Info, %i" 2015-05-15 18:26:46.666890 10.12.1.2 -> 8.8.8.8 DNS Standard query 0xcf86 A www.rax.ru tshark -u s -t ad -o column.format:"Time","%Cus:frame.time","Source, %s","Destination, %d","Protocol, %p","Info, %i" May 15, 2015 18:27:32.546288000 MSK 8.8.8.8 -> 9.9.9.9 TCP 25361 just enter -o column.format:"Time","%Cus:frame.time" answered 14 May '15, 22:30 Stepan Yudin |
@cmaynard, excellent this works exactly as I want. Thanks a million.
By the way in Edit | Preferences | Columns | I have also unchecked at "AbsTime" in Display column, to not corrupt Wireshark view I like to have in GUI. So disabled column in Wireshark can still be references in tshark. Excellent. Problem solved.
@dolphin500
I've moved the comment by @cmaynard to its own answer as it seems to do the job. Can you please "accept" the answer by clicking on the check-mark icon for the benefit of other users.
Hi Chris - is there any way to get tshark to output ISO 8601 formatted dates when using -T fields without adding a column to Wireshark? I'd like to do this with "out of the box" tshark, so to speak, so that I could format any FT_ABSOLUTE_TIME field that way in tshark. Should I put in a feature request for this? Also, if I might be so bold, ISO 8601 should really be the default date/time output format for tshark. That would make subsequent parsing of tshark output much, much easier, since most tools out there support parsing of ISO 8601 dates.
is there any way to get tshark to output ISO 8601 formatted dates when using -T fields without adding a column to Wireshark?
Not that I'm aware of; however, after you add the column in Wireshark, you could make it a hidden column if you don't want it to actually appear in Wireshark, and it will still work.
As for the suggestion of changing the tshark default date/time output to use ISO 8601 date/time format, I'm not sure. What might be nice is if the tshark output format used the exact same Wireshark columns for the given profile, then you wouldn't need to specify each field via
-T fields
at all unless you wanted something different from the current profile.Hi Chris - thanks for the info! I'm concerned about headless environments, where I wouldn't have access to Wireshark at all, just tshark. I submitted a feature request:
add ISO 8601 date format option to tshark -T fields: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10220
For headless environments, you could also directly edit the preferences file, adding whichever columns you want. It can be a little tricky in that you have to know the exact syntax, but it might be an option.
Hi
this is exactly what I want, but it doesn't work for me, I get this error
can you help me :)
As of Wireshark 1.12.0, released on July 31, 2014, all the column fields need to be prefixed with
_ws.
, so you would need to use the following instead:Thanks, it's work perfectly :)