I am looking to use tshark to export results of a filter when information in the "Info" column matches a specific string, say "DCI" (in other words, a certain keyword in the Info Column is the filter). I already know how to use t-shark to export results using normal filters, aka If I need to use Linux in order to do this, please let me know how since I have never used the Linux approach before. Any questions and comments are much appreaciated. A timely response is preferred though... asked 03 May '16, 09:25 Midimistro edited 13 May '16, 11:22 grahamb ♦ |
2 Answers:
The text in the So you cannot refer to the contents of the answered 03 May '16, 13:09 sindy |
Maybe you could pipe the
When using the This method does rely on you being able to narrow down the possible choices of Info columns to match against by some means other than by directly filtering on information in the Info column, but it might suffice for your purposes? is there any way to export all the columns to a text file? Do note that I use a custom profile. Maybe I'm missing your intent, but you can do this simply by redirecting the
answered 13 May '16, 10:27 cmaynard ♦♦ edited 13 May '16, 10:39 |
If that is the case, is there any way to export all the columns to a text file?
Do note that I use a custom profile.
"columns" are elements of the packet list. Any filterable protocol field may be made a packet list column, but not vice versa - the basic set of columns, including the Info column, has no equivalent filterable (pseudo)field (pseudo-fields are fields forged by Wireshark from the packet contents which do not represent any individual protocol field, or references to packet metadata, like timestamp, delay from previous packet etc.)
So if you know from which protocol field the string you look for is adopted into the Info column, you can filter on that protocol field; if you don't know that, there is no way to filter packets by that string.
If you run tshark without any command-line option (except
-r
), you'll get an equivalent of packet list as the only output if that's enough for you.The tshark manual declares that you can combine
-P
option with-w
to output packet list as text in parallel with writing the pcap output to a file name specified using the-w
option, but in this case, post-processing the text output won't affect which packets will be written to the file.What works but the manual doesn't mention it is to combine the
-P
option with the-O
one. In that case, you'll get the packet list row followed by formatted dissection of the protocol(s) specified using the-O
option. As the manual doesn't mention it, I don't know whether it is an intentional behaviour or a side effect.What does not work is a combination of
-P
and-T fields
- in this case,-T
wins.So depending on the number of packets you expect to filter, it may be a solution to run tshark without any option, use text processing to obtain a list of frame numbers, and then convert this list into a display filter expression to be specified using
-Y
on a subsequent run of tshark on the same input file.The last chance is to file an enhancement request (a bug of severity "Enhancement"), asking for making
_ws.col.*
(where * stands for any column name) usable not only as a parameter to-e
option (which is possible now) but also as a filterable field in-Y
display filter expressions.