4 tshark - Dump and analyze network traffic
10 S<[ B<-a> E<lt>capture autostop conditionE<gt> ] ...>
11 S<[ B<-b> E<lt>capture ring buffer optionE<gt>] ...>
12 S<[ B<-B> E<lt>capture buffer sizeE<gt> ] >
13 S<[ B<-c> E<lt>capture packet countE<gt> ]>
14 S<[ B<-C> E<lt>configuration profileE<gt> ]>
15 S<[ B<-d> E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt> ]>
17 S<[ B<-e> E<lt>fieldE<gt> ]>
18 S<[ B<-E> E<lt>field print optionE<gt> ]>
19 S<[ B<-f> E<lt>capture filterE<gt> ]>
20 S<[ B<-F> E<lt>file formatE<gt> ]>
23 S<[ B<-H> E<lt>input hosts fileE<gt> ]>
24 S<[ B<-i> E<lt>capture interfaceE<gt>|- ]>
26 S<[ B<-K> E<lt>keytabE<gt> ]>
30 S<[ B<-N> E<lt>name resolving flagsE<gt> ]>
31 S<[ B<-o> E<lt>preference settingE<gt> ] ...>
32 S<[ B<-O> E<lt>protocolsE<gt> ]>
37 S<[ B<-r> E<lt>infileE<gt> ]>
38 S<[ B<-R> E<lt>Read filterE<gt> ]>
39 S<[ B<-Y> E<lt>displaY filterE<gt> ]>
40 S<[ B<-s> E<lt>capture snaplenE<gt> ]>
41 S<[ B<-S> E<lt>separatorE<gt> ]>
42 S<[ B<-t> a|ad|d|dd|e|r|u|ud ]>
43 S<[ B<-T> pdml|psml|ps|text|fields ]>
46 S<[ B<-w> E<lt>outfileE<gt>|- ]>
47 S<[ B<-W> E<lt>file format optionE<gt>]>
49 S<[ B<-X> E<lt>eXtension optionE<gt>]>
50 S<[ B<-y> E<lt>capture link typeE<gt> ]>
51 S<[ B<-z> E<lt>statisticsE<gt> ]>
52 S<[ B<--capture-comment> E<lt>commentE<gt> ]>
53 S<[ E<lt>capture filterE<gt> ]>
56 B<-G> [fields|protocols|values|decodes|defaultprefs|currentprefs]
60 B<TShark> is a network protocol analyzer. It lets you capture packet
61 data from a live network, or read packets from a previously saved
62 capture file, either printing a decoded form of those packets to the
63 standard output or writing the packets to a file. B<TShark>'s native
64 capture file format is B<pcap> format, which is also the format used
65 by B<tcpdump> and various other tools.
67 Without any options set, B<TShark> will work much like B<tcpdump>. It will
68 use the pcap library to capture traffic from the first available network
69 interface and displays a summary line on stdout for each received packet.
71 B<TShark> is able to detect, read and write the same capture files that
72 are supported by B<Wireshark>.
73 The input file doesn't need a specific filename extension; the file
74 format and an optional gzip compression will be automatically detected.
75 Near the beginning of the DESCRIPTION section of wireshark(1) or
76 L<http://www.wireshark.org/docs/man-pages/wireshark.html>
77 is a detailed description of the way B<Wireshark> handles this, which is
78 the same way B<Tshark> handles this.
80 Compressed file support uses (and therefore requires) the zlib library.
81 If the zlib library is not present, B<TShark> will compile, but will
82 be unable to read compressed files.
84 If the B<-w> option is not specified, B<TShark> writes to the standard
85 output the text of a decoded form of the packets it captures or reads.
86 If the B<-w> option is specified, B<TShark> writes to the file
87 specified by that option the raw data of the packets, along with the
90 When writing a decoded form of packets, B<TShark> writes, by
91 default, a summary line containing the fields specified by the
92 preferences file (which are also the fields displayed in the packet list
93 pane in B<Wireshark>), although if it's writing packets as it captures
94 them, rather than writing packets from a saved capture file, it won't
95 show the "frame number" field. If the B<-V> option is specified, it
96 writes instead a view of the details of the packet, showing all the
97 fields of all protocols in the packet. If the B<-O> option is specified,
98 it will only show the full protocols specified. Use the output of
99 "B<tshark -G protocols>" to find the abbreviations of the protocols you can
102 If you want to write the decoded form of packets to a file, run
103 B<TShark> without the B<-w> option, and redirect its standard output to
104 the file (do I<not> use the B<-w> option).
106 When writing packets to a file, B<TShark>, by default, writes the
107 file in B<pcap> format, and writes all of the packets it sees to the
108 output file. The B<-F> option can be used to specify the format in which
109 to write the file. This list of available file formats is displayed by
110 the B<-F> flag without a value. However, you can't specify a file format
113 Read filters in B<TShark>, which allow you to select which packets
114 are to be decoded or written to a file, are very powerful; more fields
115 are filterable in B<TShark> than in other protocol analyzers, and the
116 syntax you can use to create your filters is richer. As B<TShark>
117 progresses, expect more and more protocol fields to be allowed in read
120 Packet capturing is performed with the pcap library. The capture filter
121 syntax follows the rules of the pcap library. This syntax is different
122 from the read filter syntax. A read filter can also be specified when
123 capturing, and only packets that pass the read filter will be displayed
124 or saved to the output file; note, however, that capture filters are much
125 more efficient than read filters, and it may be more difficult for
126 B<TShark> to keep up with a busy network if a read filter is
127 specified for a live capture.
129 A capture or read filter can either be specified with the B<-f> or B<-R>
130 option, respectively, in which case the entire filter expression must be
131 specified as a single argument (which means that if it contains spaces,
132 it must be quoted), or can be specified with command-line arguments
133 after the option arguments, in which case all the arguments after the
134 filter arguments are treated as a filter expression. Capture filters
135 are supported only when doing a live capture; read filters are supported
136 when doing a live capture and when reading a capture file, but require
137 TShark to do more work when filtering, so you might be more likely to
138 lose packets under heavy load if you're using a read filter. If the
139 filter is specified with command-line arguments after the option
140 arguments, it's a capture filter if a capture is being done (i.e., if no
141 B<-r> option was specified) and a read filter if a capture file is being
142 read (i.e., if a B<-r> option was specified).
144 The B<-G> option is a special mode that simply causes B<Tshark>
145 to dump one of several types of internal glossaries and then exit.
153 Perform a two-pass analysis. This causes tshark to buffer output until the
154 entire first pass is done, but allows it to fill in fields that require future
155 knowledge, such as 'response in frame #' fields. Also permits reassembly
156 frame dependencies to be calculated correctly.
158 =item -a E<lt>capture autostop conditionE<gt>
160 Specify a criterion that specifies when B<TShark> is to stop writing
161 to a capture file. The criterion is of the form I<test>B<:>I<value>,
162 where I<test> is one of:
164 B<duration>:I<value> Stop writing to a capture file after I<value> seconds
167 B<filesize>:I<value> Stop writing to a capture file after it reaches a size of
168 I<value> kilobytes (where a kilobyte is 1024 bytes). If this option is used
169 together with the -b option, B<TShark> will stop writing to the current
170 capture file and switch to the next one if filesize is reached. When reading a
171 capture file, B<TShark> will stop reading the file after the number of bytes
172 read exceeds this number (the complete packet will be read, so more bytes than
173 this number may be read).
175 B<files>:I<value> Stop writing to capture files after I<value> number of files
178 =item -b E<lt>capture ring buffer optionE<gt>
180 Cause B<TShark> to run in "multiple files" mode. In "multiple files" mode,
181 B<TShark> will write to several capture files. When the first capture file
182 fills up, B<TShark> will switch writing to the next file and so on.
184 The created filenames are based on the filename given with the B<-w> option,
185 the number of the file and on the creation date and time,
186 e.g. outfile_00001_20050604120117.pcap, outfile_00002_20050604120523.pcap, ...
188 With the I<files> option it's also possible to form a "ring buffer".
189 This will fill up new files until the number of files specified,
190 at which point B<TShark> will discard the data in the first file and start
191 writing to that file and so on. If the I<files> option is not set,
192 new files filled up until one of the capture stop conditions match (or
193 until the disk is full).
195 The criterion is of the form I<key>B<:>I<value>,
196 where I<key> is one of:
198 B<duration>:I<value> switch to the next file after I<value> seconds have
199 elapsed, even if the current file is not completely filled up.
201 B<filesize>:I<value> switch to the next file after it reaches a size of
202 I<value> kilobytes (where a kilobyte is 1024 bytes).
204 B<files>:I<value> begin again with the first file after I<value> number of
205 files were written (form a ring buffer). This value must be less than 100000.
206 Caution should be used when using large numbers of files: some filesystems do
207 not handle many files in a single directory well. The B<files> criterion
208 requires either B<duration> or B<filesize> to be specified to control when to
209 go to the next file. It should be noted that each B<-b> parameter takes exactly
210 one criterion; to specify two criterion, each must be preceded by the B<-b>
213 Example: B<-b filesize:1024 -b files:5> results in a ring buffer of five files
214 of size one megabyte.
216 =item -B E<lt>capture buffer sizeE<gt>
218 Set capture buffer size (in MB, default is 2MB). This is used by the
219 the capture driver to buffer packet data until that data can be written
220 to disk. If you encounter packet drops while capturing, try to increase
221 this size. Note that, while B<Tshark> attempts to set the buffer size
222 to 2MB by default, and can be told to set it to a larger value, the
223 system or interface on which you're capturing might silently limit the
224 capture buffer size to a lower value or raise it to a higher value.
226 This is available on UNIX systems with libpcap 1.0.0 or later and on
227 Windows. It is not available on UNIX systems with earlier versions of
230 This option can occur multiple times. If used before the first
231 occurrence of the B<-i> option, it sets the default capture buffer size.
232 If used after an B<-i> option, it sets the capture buffer size for
233 the interface specified by the last B<-i> option occurring before
234 this option. If the capture buffer size is not set specifically,
235 the default capture buffer size is used if provided.
237 =item -c E<lt>capture packet countE<gt>
239 Set the maximum number of packets to read when capturing live
240 data. If reading a capture file, set the maximum number of packets to read.
242 =item -C E<lt>configuration profileE<gt>
244 Run with the given configuration profile.
246 =item -d E<lt>layer typeE<gt>==E<lt>selectorE<gt>,E<lt>decode-as protocolE<gt>
248 Like Wireshark's B<Decode As...> feature, this lets you specify how a
249 layer type should be dissected. If the layer type in question (for example,
250 B<tcp.port> or B<udp.port> for a TCP or UDP port number) has the specified
251 selector value, packets should be dissected as the specified protocol.
253 Example: B<-d tcp.port==8888,http> will decode any traffic running over
254 TCP port 8888 as HTTP.
256 Example: B<-d tcp.port==8888:3,http> will decode any traffic running over
257 TCP ports 8888, 8889 or 8890 as HTTP.
259 Example: B<-d tcp.port==8888-8890,http> will decode any traffic running over
260 TCP ports 8888, 8889 or 8890 as HTTP.
262 Using an invalid selector or protocol will print out a list of valid selectors
263 and protocol names, respectively.
265 Example: B<-d .> is a quick way to get a list of valid selectors.
267 Example: B<-d ethertype==0x0800.> is a quick way to get a list of protocols that can be
268 selected with an ethertype.
272 Print a list of the interfaces on which B<TShark> can capture, and
273 exit. For each network interface, a number and an
274 interface name, possibly followed by a text description of the
275 interface, is printed. The interface name or the number can be supplied
276 to the B<-i> option to specify an interface on which to capture.
278 This can be useful on systems that don't have a command to list them
279 (e.g., Windows systems, or UNIX systems lacking B<ifconfig -a>);
280 the number can be useful on Windows 2000 and later systems, where the
281 interface name is a somewhat complex string.
283 Note that "can capture" means that B<TShark> was able to open that
284 device to do a live capture. Depending on your system you may need to
285 run tshark from an account with special privileges (for example, as
286 root) to be able to capture network traffic. If B<TShark -D> is not run
287 from such an account, it will not list any interfaces.
289 =item -e E<lt>fieldE<gt>
291 Add a field to the list of fields to display if B<-T fields> is
292 selected. This option can be used multiple times on the command line.
293 At least one field must be provided if the B<-T fields> option is
294 selected. Column names may be used prefixed with "col."
296 Example: B<-e frame.number -e ip.addr -e udp -e col.info>
298 Giving a protocol rather than a single field will print multiple items
299 of data about the protocol as a single field. Fields are separated by
300 tab characters by default. B<-E> controls the format of the printed
303 =item -E E<lt>field print optionE<gt>
305 Set an option controlling the printing of fields when B<-T fields> is
310 B<header=y|n> If B<y>, print a list of the field names given using B<-e>
311 as the first line of the output; the field name will be separated using
312 the same character as the field values. Defaults to B<n>.
314 B<separator=/t|/s|>E<lt>characterE<gt> Set the separator character to
315 use for fields. If B</t> tab will be used (this is the default), if
316 B</s>, a single space will be used. Otherwise any character that can be
317 accepted by the command line as part of the option may be used.
319 B<occurrence=f|l|a> Select which occurrence to use for fields that have
320 multiple occurrences. If B<f> the first occurrence will be used, if B<l>
321 the last occurrence will be used and if B<a> all occurrences will be used
322 (this is the default).
324 B<aggregator=,|/s|>E<lt>characterE<gt> Set the aggregator character to
325 use for fields that have multiple occurrences. If B<,> a comma will be used
326 (this is the default), if B</s>, a single space will be used. Otherwise
327 any character that can be accepted by the command line as part of the
330 B<quote=d|s|n> Set the quote character to use to surround fields. B<d>
331 uses double-quotes, B<s> single-quotes, B<n> no quotes (the default).
333 =item -f E<lt>capture filterE<gt>
335 Set the capture filter expression.
337 This option can occur multiple times. If used before the first
338 occurrence of the B<-i> option, it sets the default capture filter expression.
339 If used after an B<-i> option, it sets the capture filter expression for
340 the interface specified by the last B<-i> option occurring before
341 this option. If the capture filter expression is not set specifically,
342 the default capture filter expression is used if provided.
344 =item -F E<lt>file formatE<gt>
346 Set the file format of the output capture file written using the B<-w>
347 option. The output written with the B<-w> option is raw packet data, not
348 text, so there is no B<-F> option to request text output. The option B<-F>
349 without a value will list the available formats.
353 This option causes the output file(s) to be created with group-read permission
354 (meaning that the output file(s) can be read by other members of the calling
357 =item -G [fields|protocols|values|decodes|defaultprefs|currentprefs]
359 The B<-G> option will cause B<Tshark> to dump one of several types of glossaries
360 and then exit. If no specific glossary type is specified, then the B<fields> report will be generated by default.
362 The available report types include:
364 B<fields> Dumps the contents of the registration database to
365 stdout. An independent program can take this output and format it into nice
366 tables or HTML or whatever. There is one record per line. Each record is
367 either a protocol or a header field, differentiated by the first field.
368 The fields are tab-delimited.
373 * Field 2 = descriptive protocol name
374 * Field 3 = protocol abbreviation
379 * Field 2 = descriptive field name
380 * Field 3 = field abbreviation
381 * Field 4 = type ( textual representation of the ftenum type )
382 * Field 5 = parent protocol abbreviation
383 * Field 6 = base for display (for integer types); "parent bitfield width" for FT_BOOLEAN
384 * Field 7 = bitmask: format: hex: 0x....
385 * Field 8 = blurb describing field
387 B<protocols> Dumps the protocols in the registration database to stdout.
388 An independent program can take this output and format it into nice tables
389 or HTML or whatever. There is one record per line. The fields are tab-delimited.
391 * Field 1 = protocol name
392 * Field 2 = protocol short name
393 * Field 3 = protocol filter name
395 B<values> Dumps the value_strings, range_strings or true/false strings
396 for fields that have them. There is one record per line. Fields are
397 tab-delimited. There are three types of records: Value String, Range
398 String and True/False String. The first field, 'V', 'R' or 'T', indicates
404 * Field 2 = field abbreviation to which this value string corresponds
405 * Field 3 = Integer value
411 * Field 2 = field abbreviation to which this range string corresponds
412 * Field 3 = Integer value: lower bound
413 * Field 4 = Integer value: upper bound
419 * Field 2 = field abbreviation to which this true/false string corresponds
420 * Field 3 = True String
421 * Field 4 = False String
423 B<decodes> Dumps the "layer type"/"decode as" associations to stdout.
424 There is one record per line. The fields are tab-delimited.
426 * Field 1 = layer type, e.g. "tcp.port"
427 * Field 2 = selector in decimal
428 * Field 3 = "decode as" name, e.g. "http"
430 B<defaultprefs> Dumps a default preferences file to stdout.
432 B<currentprefs> Dumps a copy of the current preferences file to stdout.
436 Print the version and options and exits.
438 =item -H E<lt>input hosts fileE<gt>
440 Read a list of entries from a "hosts" file, which will then be written
441 to a capture file. Implies B<-W n>. Can be called multiple times.
443 The "hosts" file format is documented at
444 L<http://en.wikipedia.org/wiki/Hosts_(file)>.
446 =item -i E<lt>capture interfaceE<gt> | -
448 Set the name of the network interface or pipe to use for live packet
451 Network interface names should match one of the names listed in
452 "B<tshark -D>" (described above); a number, as reported by
453 "B<tshark -D>", can also be used. If you're using UNIX, "B<netstat
454 -i>" or "B<ifconfig -a>" might also work to list interface names,
455 although not all versions of UNIX support the B<-a> option to B<ifconfig>.
457 If no interface is specified, B<TShark> searches the list of
458 interfaces, choosing the first non-loopback interface if there are any
459 non-loopback interfaces, and choosing the first loopback interface if
460 there are no non-loopback interfaces. If there are no interfaces at all,
461 B<TShark> reports an error and doesn't start the capture.
463 Pipe names should be either the name of a FIFO (named pipe) or ``-'' to
464 read data from the standard input. Data read from pipes must be in
465 standard pcap format.
467 This option can occur multiple times. When capturing from multiple
468 interfaces, the capture file will be saved in pcap-ng format.
470 Note: the Win32 version of B<TShark> doesn't support capturing from
475 Put the interface in "monitor mode"; this is supported only on IEEE
476 802.11 Wi-Fi interfaces, and supported only on some operating systems.
478 Note that in monitor mode the adapter might disassociate from the
479 network with which it's associated, so that you will not be able to use
480 any wireless networks with that adapter. This could prevent accessing
481 files on a network server, or resolving host names or network addresses,
482 if you are capturing in monitor mode and are not connected to another
483 network with another adapter.
485 This option can occur multiple times. If used before the first
486 occurrence of the B<-i> option, it enables the monitor mode for all interfaces.
487 If used after an B<-i> option, it enables the monitor mode for
488 the interface specified by the last B<-i> option occurring before
491 =item -K E<lt>keytabE<gt>
493 Load kerberos crypto keys from the specified keytab file.
494 This option can be used multiple times to load keys from several files.
496 Example: B<-K krb5.keytab>
500 Flush the standard output after the information for each packet is
501 printed. (This is not, strictly speaking, line-buffered if B<-V>
502 was specified; however, it is the same as line-buffered if B<-V> wasn't
503 specified, as only one line is printed for each packet, and, as B<-l> is
504 normally used when piping a live capture to a program or script, so that
505 output for a packet shows up as soon as the packet is seen and
506 dissected, it should work just as well as true line-buffering. We do
507 this as a workaround for a deficiency in the Microsoft Visual C++ C
510 This may be useful when piping the output of B<TShark> to another
511 program, as it means that the program to which the output is piped will
512 see the dissected data for a packet as soon as B<TShark> sees the
513 packet and generates that output, rather than seeing it only when the
514 standard output buffer containing that data fills up.
518 List the data link types supported by the interface and exit. The reported
519 link types can be used for the B<-y> option.
523 Disable network object name resolution (such as hostname, TCP and UDP port
524 names); the B<-N> flag might override this one.
526 =item -N E<lt>name resolving flagsE<gt>
528 Turn on name resolving only for particular types of addresses and port
529 numbers, with name resolving for other types of addresses and port
530 numbers turned off. This flag overrides B<-n> if both B<-N> and B<-n> are
531 present. If both B<-N> and B<-n> flags are not present, all name resolutions
534 The argument is a string that may contain the letters:
536 B<m> to enable MAC address resolution
538 B<n> to enable network address resolution
540 B<N> to enable using external resolvers (e.g., DNS) for network address
543 B<t> to enable transport-layer port number resolution
545 B<C> to enable concurrent (asynchronous) DNS lookups
547 =item -o E<lt>preferenceE<gt>:E<lt>valueE<gt>
549 Set a preference value, overriding the default value and any value read
550 from a preference file. The argument to the option is a string of the
551 form I<prefname>B<:>I<value>, where I<prefname> is the name of the
552 preference (which is the same name that would appear in the preference
553 file), and I<value> is the value to which it should be set.
555 =item -O E<lt>protocolsE<gt>
557 Similar to the B<-V> option, but causes B<TShark> to only show a detailed view
558 of the comma-separated list of I<protocols> specified, rather than a detailed
559 view of all protocols. Use the output of "B<tshark -G protocols>" to find the
560 abbreviations of the protocols you can specify.
564 I<Don't> put the interface into promiscuous mode. Note that the
565 interface might be in promiscuous mode for some other reason; hence,
566 B<-p> cannot be used to ensure that the only traffic that is captured is
567 traffic sent to or from the machine on which B<TShark> is running,
568 broadcast traffic, and multicast traffic to addresses received by that
571 This option can occur multiple times. If used before the first
572 occurrence of the B<-i> option, no interface will be put into the
574 If used after an B<-i> option, the interface specified by the last B<-i>
575 option occurring before this option will not be put into the
580 Decode and display the packet summary, even if writing raw packet data using
585 When capturing packets, don't display the continuous count of packets
586 captured that is normally shown when saving a capture to a file;
587 instead, just display, at the end of the capture, a count of packets
588 captured. On systems that support the SIGINFO signal, such as various
589 BSDs, you can cause the current count to be displayed by typing your
590 "status" character (typically control-T, although it
591 might be set to "disabled" by default on at least some BSDs, so you'd
592 have to explicitly set it to use it).
594 When reading a capture file, or when capturing and not saving to a file,
595 don't print packet information; this is useful if you're using a B<-z>
596 option to calculate statistics and don't want the packet information
597 printed, just the statistics.
601 When capturing packets, only display true errors. This outputs less
602 than the B<-q> option, so the interface name and total packet
603 count and the end of a capture are not sent to stderr.
605 =item -r E<lt>infileE<gt>
607 Read packet data from I<infile>, can be any supported capture file format
608 (including gzipped files). It's B<not> possible to use named pipes
611 =item -R E<lt>Read filterE<gt>
613 Cause the specified filter (which uses the syntax of read/display filters,
614 rather than that of capture filters) to be applied during the first pass of
615 analysis. Packets not matching the filter are not considered for future
616 passes. Only makes sense with multiple passes, see -2. For regular filtering
617 on single-pass dissect see -Y instead.
619 Note that forward-looking fields such as 'response in frame #' cannot be used
620 with this filter, since they will not have been calculate when this filter is
623 =item -Y E<lt>displaY filterE<gt>
625 Cause the specified filter (which uses the syntax of read/display filters,
626 rather than that of capture filters) to be applied before printing a
627 decoded form of packets or writing packets to a file. Packets matching the
628 filter are printed or written to file; packets that the matching packets
629 depend upon (e.g., fragments), are not printed but are written to file;
630 packets not matching the filter nor depended upon are discarded rather
631 than being printed or written.
633 Use this instead of -R for filtering using single-pass analysis. If doing
634 two-pass analysis (see -2) then only packets matching the read filter (if there
635 is one) will be checked against this filter.
637 =item -s E<lt>capture snaplenE<gt>
639 Set the default snapshot length to use when capturing live data.
640 No more than I<snaplen> bytes of each network packet will be read into
641 memory, or saved to disk. A value of 0 specifies a snapshot length of
642 65535, so that the full packet is captured; this is the default.
644 This option can occur multiple times. If used before the first
645 occurrence of the B<-i> option, it sets the default snapshot length.
646 If used after an B<-i> option, it sets the snapshot length for
647 the interface specified by the last B<-i> option occurring before
648 this option. If the snapshot length is not set specifically,
649 the default snapshot length is used if provided.
651 =item -S E<lt>separatorE<gt>
653 Set the line separator to be printed between packets.
655 =item -t a|ad|d|dd|e|r|u|ud
657 Set the format of the packet timestamp printed in summary lines.
658 The format can be one of:
660 B<a> absolute: The absolute time is the actual time the packet was captured,
661 with no date displayed
663 B<ad> absolute with date: The absolute date and time is the actual time and
664 date the packet was captured
666 B<d> delta: The delta time is the time since the previous packet was
669 B<dd> delta_displayed: The delta_displayed time is the time since the
670 previous displayed packet was captured
672 B<e> epoch: The time in seconds since epoch (Jan 1, 1970 00:00:00)
674 B<r> relative: The relative time is the time elapsed between the first packet
675 and the current packet
677 B<u> UTC: The UTC time is the actual time the packet was captured,
678 with no date displayed
680 B<ud> UTC with date: The UTC date and time is the actual time and
681 date the packet was captured
683 The default format is relative.
685 =item -T pdml|psml|ps|text|fields
687 Set the format of the output when viewing decoded packet data. The
690 B<pdml> Packet Details Markup Language, an XML-based format for the details of
691 a decoded packet. This information is equivalent to the packet details
692 printed with the B<-V> flag.
694 B<psml> Packet Summary Markup Language, an XML-based format for the summary
695 information of a decoded packet. This information is equivalent to the
696 information shown in the one-line summary printed by default.
698 B<ps> PostScript for a human-readable one-line summary of each of the packets,
699 or a multi-line view of the details of each of the packets, depending on
700 whether the B<-V> flag was specified.
702 B<text> Text of a human-readable one-line summary of each of the packets, or a
703 multi-line view of the details of each of the packets, depending on
704 whether the B<-V> flag was specified. This is the default.
706 B<fields> The values of fields specified with the B<-e> option, in a
707 form specified by the B<-E> option. For example,
709 -T fields -E separator=, -E quote=d
711 would generate comma-separated values (CSV) output suitable for importing
712 into your favorite spreadsheet program.
717 Print the version and exit.
721 Cause B<TShark> to print a view of the packet details.
723 =item -w E<lt>outfileE<gt> | -
725 Write raw packet data to I<outfile> or to the standard output if
728 NOTE: -w provides raw packet data, not text. If you want text output
729 you need to redirect stdout (e.g. using '>'), don't use the B<-w>
732 =item -W E<lt>file format optionE<gt>
734 Save extra information in the file if the format supports it. For
739 will save host name resolution records along with captured packets.
741 Future versions of Wireshark may automatically change the capture format to
744 The argument is a string that may contain the following letter:
746 B<n> write network address resolution information (pcapng only)
750 Cause B<TShark> to print a hex and ASCII dump of the packet data
751 after printing the summary and/or details, if either are also being displayed.
753 =item -X E<lt>eXtension optionsE<gt>
755 Specify an option to be passed to a B<TShark> module. The eXtension option
756 is in the form I<extension_key>B<:>I<value>, where I<extension_key> can be:
758 B<lua_script>:I<lua_script_filename> tells B<Wireshark> to load the given script in addition to the
761 =item -y E<lt>capture link typeE<gt>
763 Set the data link type to use while capturing packets. The values
764 reported by B<-L> are the values that can be used.
766 This option can occur multiple times. If used before the first
767 occurrence of the B<-i> option, it sets the default capture link type.
768 If used after an B<-i> option, it sets the capture link type for
769 the interface specified by the last B<-i> option occurring before
770 this option. If the capture link type is not set specifically,
771 the default capture link type is used if provided.
773 =item -z E<lt>statisticsE<gt>
775 Get B<TShark> to collect various types of statistics and display the result
776 after finishing reading the capture file. Use the B<-q> flag if you're
777 reading a capture file and only want the statistics printed, not any
778 per-packet information.
780 Note that the B<-z proto> option is different - it doesn't cause
781 statistics to be gathered and printed when the capture is complete, it
782 modifies the regular packet summary output to include the values of
783 fields specified with the option. Therefore you must not use the B<-q>
784 option, as that option would suppress the printing of the regular packet
785 summary output, and must also not use the B<-V> option, as that would
786 cause packet detail information rather than packet summary information
789 Currently implemented statistics are:
795 Display all possible values for B<-z>.
797 =item B<-z> afp,srt[,I<filter>]
799 =item B<-z> camel,srt
801 =item B<-z> compare,I<start>,I<stop>,I<ttl[0|1]>,I<order[0|1]>,I<variance>[,I<filter>]
803 If the optional I<filter> is specified, only those packets that match the
804 filter will be used in the calculations.
806 =item B<-z> conv,I<type>[,I<filter>]
808 Create a table that lists all conversations that could be seen in the
809 capture. I<type> specifies the conversation endpoint types for which we
810 want to generate the statistics; currently the supported ones are:
812 "eth" Ethernet addresses
813 "fc" Fibre Channel addresses
814 "fddi" FDDI addresses
816 "ipv6" IPv6 addresses
818 "tcp" TCP/IP socket pairs Both IPv4 and IPv6 are supported
819 "tr" Token Ring addresses
820 "udp" UDP/IP socket pairs Both IPv4 and IPv6 are supported
822 If the optional I<filter> is specified, only those packets that match the
823 filter will be used in the calculations.
825 The table is presented with one line for each conversation and displays
826 the number of packets/bytes in each direction as well as the total
827 number of packets/bytes. The table is sorted according to the total
830 =item B<-z> dcerpc,srt,I<uuid>,I<major>.I<minor>[,I<filter>]
832 Collect call/reply SRT (Service Response Time) data for DCERPC interface I<uuid>,
833 version I<major>.I<minor>.
834 Data collected is the number of calls for each procedure, MinSRT, MaxSRT
837 Example: S<B<-z dcerpc,srt,12345778-1234-abcd-ef00-0123456789ac,1.0>> will collect data for the CIFS SAMR Interface.
839 This option can be used multiple times on the command line.
841 If the optional I<filter> is provided, the stats will only be calculated
842 on those calls that match that filter.
844 Example: S<B<-z dcerpc,srt,12345778-1234-abcd-ef00-0123456789ac,1.0,ip.addr==1.2.3.4>> will collect SAMR
845 SRT statistics for a specific host.
847 =item B<-z> diameter,avp[,I<cmd.code>,I<field>,I<field>,I<...>]
849 This option enables extraction of most important diameter fields from large capture files.
850 Exactly one text line for each diameter message with matched B<diameter.cmd.code> will be printed.
852 Empty diameter command code or '*' can be specified to mach any B<diameter.cmd.code>
854 Example: B<-z diameter,avp> extract default field set from diameter messages.
856 Example: B<-z diameter,avp,280> extract default field set from diameter DWR messages.
858 Example: B<-z diameter,avp,272> extract default field set from diameter CC messages.
860 Extract most important fields from diameter CC messages:
862 B<tshark -r file.cap.gz -q -z diameter,avp,272,CC-Request-Type,CC-Request-Number,Session-Id,Subscription-Id-Data,Rating-Group,Result-Code>
864 Following fields will be printed out for each diameter message:
866 "frame" Frame number.
867 "time" Unix time of the frame arrival.
868 "src" Source address.
869 "srcport" Source port.
870 "dst" Destination address.
871 "dstport" Destination port.
872 "proto" Constant string 'diameter', which can be used for post processing of tshark output. E.g. grep/sed/awk.
873 "msgnr" seq. number of diameter message within the frame. E.g. '2' for the third diameter message in the same frame.
874 "is_request" '0' if message is a request, '1' if message is an answer.
875 "cmd" diameter.cmd_code, E.g. '272' for credit control messages.
876 "req_frame" Number of frame where matched request was found or '0'.
877 "ans_frame" Number of frame where matched answer was found or '0'.
878 "resp_time" response time in seconds, '0' in case if matched Request/Answer is not found in trace. E.g. in the begin or end of capture.
880 B<-z diameter,avp> option is much faster than B<-V -T text> or B<-T pdml> options.
882 B<-z diameter,avp> option is more powerful than B<-T field> and B<-z proto,colinfo> options.
884 Multiple diameter messages in one frame are supported.
886 Several fields with same name within one diameter message are supported, e.g. I<diameter.Subscription-Id-Data> or I<diameter.Rating-Group>.
888 Note: B<tshark -q> option is recommended to suppress default B<tshark> output.
890 =item B<-z> expert[I<,error|,warn|,note|,chat>][I<,filter>]
892 Collects information about all expert info, and will display them in order,
895 Example: B<-z expert,sip> will show expert items of all severity for frames that
896 match the sip protocol.
898 This option can be used multiple times on the command line.
900 If the optional I<filter> is provided, the stats will only be calculated
901 on those calls that match that filter.
903 Example: B<-z "expert,note,tcp"> will only collect expert items for frames that
904 include the tcp protocol, with a severity of note or higher.
906 =item B<-z> follow,I<prot>,I<mode>,I<filter>[I<,range>]
908 Displays the contents of a TCP or UDP stream between two nodes. The data
909 sent by the second node is prefixed with a tab to differentiate it from the
910 data sent by the first node.
912 I<prot> specifies the transport protocol. It can be one of:
917 I<mode> specifies the output mode. It can be one of:
918 B<ascii> ASCII output with dots for non-printable characters
919 B<hex> Hexadecimal and ASCII data with offsets
920 B<raw> Hexadecimal data
922 Since the output in B<ascii> mode may contain newlines, the length of each section
923 of output plus a newline precedes each section of output.
925 I<filter> specifies the stream to be displayed. UDP streams are selected with
926 IP address plus port pairs. TCP streams are selected with either the stream
927 index or IP address plus port pairs. For example:
928 B<ip-addr0>:B<port0>,B<ip-addr1>:B<port1>
931 I<range> optionally specifies which "chunks" of the stream should be displayed.
933 Example: B<-z "follow,tcp,hex,1"> will display the contents of the first TCP
934 stream in "hex" format.
936 ===================================================================
938 Filter: tcp.stream eq 1
939 Node 0: 200.57.7.197:32891
940 Node 1: 200.57.7.198:2906
941 00000000 00 00 00 22 00 00 00 07 00 0a 85 02 07 e9 00 02 ...".... ........
942 00000010 07 e9 06 0f 00 0d 00 04 00 00 00 01 00 03 00 06 ........ ........
943 00000020 1f 00 06 04 00 00 ......
944 00000000 00 01 00 00 ....
947 Example: B<-z "follow,tcp,ascii,200.57.7.197:32891,200.57.7.198:2906"> will
948 display the contents of a TCP stream between 200.57.7.197 port 32891 and
949 200.57.7.98 port 2906.
951 ===================================================================
953 Filter: (ommitted for readability)
954 Node 0: 200.57.7.197:32891
955 Node 1: 200.57.7.198:2906
962 =item B<-z> h225,counter[I<,filter>]
964 Count ITU-T H.225 messages and their reasons. In the first column you get a
965 list of H.225 messages and H.225 message reasons, which occur in the current
966 capture file. The number of occurrences of each message or reason is displayed
967 in the second column.
969 Example: B<-z h225,counter>.
971 If the optional I<filter> is provided, the stats will only be calculated
972 on those calls that match that filter.
973 Example: use B<-z "h225,counter,ip.addr==1.2.3.4"> to only collect stats for
974 H.225 packets exchanged by the host at IP address 1.2.3.4 .
976 This option can be used multiple times on the command line.
978 =item B<-z> h225,srt[I<,filter>]
980 Collect requests/response SRT (Service Response Time) data for ITU-T H.225 RAS.
981 Data collected is number of calls of each ITU-T H.225 RAS Message Type,
982 Minimum SRT, Maximum SRT, Average SRT, Minimum in Packet, and Maximum in Packet.
983 You will also get the number of Open Requests (Unresponded Requests),
984 Discarded Responses (Responses without matching request) and Duplicate Messages.
986 Example: B<-z h225,srt>
988 This option can be used multiple times on the command line.
990 If the optional I<filter> is provided, the stats will only be calculated
991 on those calls that match that filter.
993 Example: B<-z "h225,srt,ip.addr==1.2.3.4"> will only collect stats for
994 ITU-T H.225 RAS packets exchanged by the host at IP address 1.2.3.4 .
996 =item B<-z> hosts[,ipv4][,ipv6]
998 Dump any collected IPv4 and/or IPv6 addresses in "hosts" format. Both IPv4
999 and IPv6 addresses are dumped by default.
1001 Addresses are collected from a number of sources, including standard "hosts"
1002 files and captured traffic.
1004 =item B<-z> http,stat,
1006 Calculate the HTTP statistics distribution. Displayed values are
1007 the HTTP status codes and the HTTP request methods.
1009 =item B<-z> http,tree
1011 Calculate the HTTP packet distribution. Displayed values are the
1012 HTTP request modes and the HTTP status codes.
1014 =item B<-z> http_req,tree
1016 Calculate the HTTP requests by server. Displayed values are the
1017 server name and the URI path.
1019 =item B<-z> http_srv,tree
1021 Calculate the HTTP requests and responses by server. For the HTTP
1022 requests, displayed values are the server IP address and server
1023 hostname. For the HTTP responses, displayed values are the server
1024 IP address and status.
1026 =item B<-z> icmp,srt[,I<filter>]
1028 Compute total ICMP echo requests, replies, loss, and percent loss, as well as
1029 minimum, maximum, mean, median and sample standard deviation SRT statistics
1030 typical of what ping provides.
1032 Example: S<B<-z icmp,srt,ip.src==1.2.3.4>> will collect ICMP SRT statistics
1033 for ICMP echo request packets originating from a specific host.
1035 This option can be used multiple times on the command line.
1037 =item B<-z> icmpv6,srt[,I<filter>]
1039 Compute total ICMPv6 echo requests, replies, loss, and percent loss, as well as
1040 minimum, maximum, mean, median and sample standard deviation SRT statistics
1041 typical of what ping provides.
1043 Example: S<B<-z icmpv6,srt,ipv6.src==fe80::1>> will collect ICMPv6 SRT statistics
1044 for ICMPv6 echo request packets originating from a specific host.
1046 This option can be used multiple times on the command line.
1048 =item B<-z> io,phs[,I<filter>]
1050 Create Protocol Hierarchy Statistics listing both number of packets and bytes.
1051 If no I<filter> is specified the statistics will be calculated for all packets.
1052 If a I<filter> is specified statistics will only be calculated for those
1053 packets that match the filter.
1055 This option can be used multiple times on the command line.
1057 =item B<-z> io,stat,I<interval>[,I<filter>][,I<filter>][,I<filter>]...
1059 Collect packet/bytes statistics for the capture in intervals of
1060 I<interval> seconds. I<Interval> can be specified either as a whole or
1061 fractional second and can be specified with microsecond (us) resolution.
1062 If I<interval> is 0, the statistics will be calculated over all packets.
1064 If no I<filter> is specified the statistics will be calculated for all packets.
1065 If one or more I<filters> are specified statistics will be calculated for
1066 all filters and presented with one column of statistics for each filter.
1068 This option can be used multiple times on the command line.
1070 Example: B<-z io,stat,1,ip.addr==1.2.3.4> will generate 1 second
1071 statistics for all traffic to/from host 1.2.3.4.
1073 Example: B<-z "io,stat,0.001,smb&&ip.addr==1.2.3.4"> will generate 1ms
1074 statistics for all SMB packets to/from host 1.2.3.4.
1076 The examples above all use the standard syntax for generating statistics
1077 which only calculates the number of packets and bytes in each interval.
1079 B<io,stat> can also do much more statistics and calculate COUNT(), SUM(),
1080 MIN(), MAX(), AVG() and LOAD() using a slightly different filter syntax:
1082 =item -z io,stat,I<interval>,E<34>[COUNT|SUM|MIN|MAX|AVG|LOAD](I<field>)I<filter>E<34>
1084 NOTE: One important thing to note here is that the filter is not optional
1085 and that the field that the calculation is based on MUST be part of the filter
1086 string or the calculation will fail.
1088 So: B<-z io,stat,0.010,AVG(smb.time)> does not work. Use B<-z
1089 io,stat,0.010,AVG(smb.time)smb.time> instead. Also be aware that a field
1090 can exist multiple times inside the same packet and will then be counted
1091 multiple times in those packets.
1093 NOTE: A second important thing to note is that the system setting for
1094 decimal separator must be set to "."! If it is set to "," the statistics
1095 will not be displayed per filter.
1097 B<COUNT(I<field>)I<filter>> - Calculates the number of times that the
1098 field I<name> (not its value) appears per interval in the filtered packet list.
1099 ''I<field>'' can be any display filter name.
1101 Example: B<-z io,stat,0.010,E<34>COUNT(smb.sid)smb.sidE<34>>
1103 This will count the total number of SIDs seen in each 10ms interval.
1105 B<SUM(I<field>)I<filter>> - Unlike COUNT, the I<values> of the
1106 specified field are summed per time interval.
1107 ''I<field>'' can only be a named integer, float, double or relative time field.
1109 Example: B<-z io,stat,0.010,E<34>SUM(frame.len)frame.lenE<34>>
1111 Reports the total number of bytes that were transmitted bidirectionally in
1112 all the packets within a 10 millisecond interval.
1114 B<MIN/MAX/AVG(I<field>)I<filter>> - The minimum, maximum, or average field value
1115 in each interval is calculated. The specified field must be a named integer,
1116 float, double or relative time field. For relative time fields, the output is presented in
1117 seconds with six decimal digits of precision rounded to the nearest microsecond.
1119 In the following example, the time of the first Read_AndX call, the last Read_AndX
1120 response values are displayed and the minimum, maximum, and average Read response times
1121 (SRTs) are calculated. NOTE: If the DOS command shell line continuation character, ''^''
1122 is used, each line cannot end in a comma so it is placed at the beginning of each
1125 tshark -o tcp.desegment_tcp_streams:FALSE -n -q -r smb_reads.cap -z io,stat,0,
1126 "MIN(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==0",
1127 "MAX(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==1",
1128 "MIN(smb.time)smb.time and smb.cmd==0x2e",
1129 "MAX(smb.time)smb.time and smb.cmd==0x2e",
1130 "AVG(smb.time)smb.time and smb.cmd==0x2e"
1133 ======================================================================================================
1135 Column #0: MIN(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==0
1136 Column #1: MAX(frame.time_relative)frame.time_relative and smb.cmd==0x2e and smb.flags.response==1
1137 Column #2: MIN(smb.time)smb.time and smb.cmd==0x2e
1138 Column #3: MAX(smb.time)smb.time and smb.cmd==0x2e
1139 Column #4: AVG(smb.time)smb.time and smb.cmd==0x2e
1140 | Column #0 | Column #1 | Column #2 | Column #3 | Column #4 |
1141 Time | MIN | MAX | MIN | MAX | AVG |
1142 000.000- 0.000000 7.704054 0.000072 0.005539 0.000295
1143 ======================================================================================================
1145 The following command displays the average SMB Read response PDU size, the
1146 total number of read PDU bytes, the average SMB Write request PDU size, and
1147 the total number of bytes transferred in SMB Write PDUs:
1149 tshark -n -q -r smb_reads_writes.cap -z io,stat,0,
1150 "AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to",
1151 "SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to",
1152 "AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to",
1153 "SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to"
1155 =====================================================================================
1157 Column #0: AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to
1158 Column #1: SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2e and smb.response_to
1159 Column #2: AVG(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to
1160 Column #3: SUM(smb.file.rw.length)smb.file.rw.length and smb.cmd==0x2f and not smb.response_to
1161 | Column #0 | Column #1 | Column #2 | Column #3 |
1162 Time | AVG | SUM | AVG | SUM |
1163 000.000- 30018 28067522 72 3240
1164 =====================================================================================
1166 B<LOAD(I<field>)I<filter>> - The LOAD/Queue-Depth
1167 in each interval is calculated. The specified field must be a relative time field that represents a response time. For example smb.time.
1168 For each interval the Queue-Depth for the specified protocol is calculated.
1170 The following command displays the average SMB LOAD.
1171 A value of 1.0 represents one I/O in flight.
1173 tshark -n -q -r smb_reads_writes.cap
1174 -z "io,stat,0.001,LOAD(smb.time)smb.time"
1176 ============================================================================
1178 Interval: 0.001000 secs
1179 Column #0: LOAD(smb.time)smb.time
1182 0000.000000-0000.001000 1.000000
1183 0000.001000-0000.002000 0.741000
1184 0000.002000-0000.003000 0.000000
1185 0000.003000-0000.004000 1.000000
1189 B<FRAMES | BYTES[()I<filter>]> - Displays the total number of frames or bytes.
1190 The filter field is optional but if included it must be prepended with ''()''.
1192 The following command displays five columns: the total number of frames and bytes
1193 (transferred bidirectionally) using a single comma, the same two stats using the FRAMES and BYTES
1194 subcommands, the total number of frames containing at least one SMB Read response, and
1195 the total number of bytes transmitted to the client (unidirectionally) at IP address 10.1.0.64.
1197 tshark -o tcp.desegment_tcp_streams:FALSE -n -q -r smb_reads.cap -z io,stat,0,,FRAMES,BYTES,
1198 "FRAMES()smb.cmd==0x2e and smb.response_to","BYTES()ip.dst==10.1.0.64"
1200 =======================================================================================================================
1205 Column #3: FRAMES()smb.cmd==0x2e and smb.response_to
1206 Column #4: BYTES()ip.dst==10.1.0.64
1207 | Column #0 | Column #1 | Column #2 | Column #3 | Column #4 |
1208 Time | Frames | Bytes | FRAMES | BYTES | FRAMES | BYTES |
1209 000.000- 33576 29721685 33576 29721685 870 29004801
1210 =======================================================================================================================
1212 =item B<-z> mac-lte,stat[I<,filter>]
1214 This option will activate a counter for LTE MAC messages. You will get
1215 information about the maximum number of UEs/TTI, common messages and
1216 various counters for each UE that appears in the log.
1218 Example: B<-z mac-lte,stat>.
1220 This option can be used multiple times on the command line.
1222 If the optional I<filter> is provided, the stats will only be calculated
1223 for those frames that match that filter.
1224 Example: B<-z "mac-lte,stat,mac-lte.rnti>3000"> will only collect stats for
1225 UEs with an assigned RNTI whose value is more than 3000.
1227 =item B<-z> megaco,rtd[I<,filter>]
1229 Collect requests/response RTD (Response Time Delay) data for MEGACO.
1230 (This is similar to B<-z smb,srt>). Data collected is the number of calls
1231 for each known MEGACO Type, MinRTD, MaxRTD and AvgRTD.
1232 Additionally you get the number of duplicate requests/responses,
1233 unresponded requests, responses, which don't match with any request.
1234 Example: B<-z megaco,rtd>.
1236 If the optional I<filter> is provided, the stats will only be calculated
1237 on those calls that match that filter.
1238 Example: B<-z "megaco,rtd,ip.addr==1.2.3.4"> will only collect stats for
1239 MEGACO packets exchanged by the host at IP address 1.2.3.4 .
1241 This option can be used multiple times on the command line.
1243 =item B<-z> mgcp,rtd[I<,filter>]
1245 Collect requests/response RTD (Response Time Delay) data for MGCP.
1246 (This is similar to B<-z smb,srt>). Data collected is the number of calls
1247 for each known MGCP Type, MinRTD, MaxRTD and AvgRTD.
1248 Additionally you get the number of duplicate requests/responses,
1249 unresponded requests, responses, which don't match with any request.
1250 Example: B<-z mgcp,rtd>.
1252 This option can be used multiple times on the command line.
1254 If the optional I<filter> is provided, the stats will only be calculated
1255 on those calls that match that filter.
1256 Example: B<-z "mgcp,rtd,ip.addr==1.2.3.4"> will only collect stats for
1257 MGCP packets exchanged by the host at IP address 1.2.3.4 .
1259 =item B<-z> proto,colinfo,I<filter>,I<field>
1261 Append all I<field> values for the packet to the Info column of the
1262 one-line summary output.
1263 This feature can be used to append arbitrary fields to the Info column
1264 in addition to the normal content of that column.
1265 I<field> is the display-filter name of a field which value should be placed
1267 I<filter> is a filter string that controls for which packets the field value
1268 will be presented in the info column. I<field> will only be presented in the
1269 Info column for the packets which match I<filter>.
1271 NOTE: In order for B<TShark> to be able to extract the I<field> value
1272 from the packet, I<field> MUST be part of the I<filter> string. If not,
1273 B<TShark> will not be able to extract its value.
1275 For a simple example to add the "nfs.fh.hash" field to the Info column
1276 for all packets containing the "nfs.fh.hash" field, use
1278 B<-z proto,colinfo,nfs.fh.hash,nfs.fh.hash>
1280 To put "nfs.fh.hash" in the Info column but only for packets coming from
1283 B<-z "proto,colinfo,nfs.fh.hash && ip.src==1.2.3.4,nfs.fh.hash">
1285 This option can be used multiple times on the command line.
1287 =item B<-z> rlc-lte,stat[I<,filter>]
1289 This option will activate a counter for LTE RLC messages. You will get
1290 information about common messages and various counters for each UE that appears
1293 Example: B<-z rlc-lte,stat>.
1295 This option can be used multiple times on the command line.
1297 If the optional I<filter> is provided, the stats will only be calculated
1298 for those frames that match that filter.
1299 Example: B<-z "rlc-lte,stat,rlc-lte.ueid>3000"> will only collect stats for
1300 UEs with a UEId of more than 3000.
1302 =item B<-z> rpc,programs
1304 Collect call/reply SRT data for all known ONC-RPC programs/versions.
1305 Data collected is number of calls for each protocol/version, MinSRT,
1307 This option can only be used once on the command line.
1309 =item B<-z> rpc,srt,I<program>,I<version>[,I<filter>]
1311 Collect call/reply SRT (Service Response Time) data for I<program>/I<version>.
1312 Data collected is the number of calls for each procedure, MinSRT, MaxSRT,
1313 AvgSRT, and the total time taken for each procedure.
1316 Example: B<-z rpc,srt,100003,3> will collect data for NFS v3.
1318 This option can be used multiple times on the command line.
1320 If the optional I<filter> is provided, the stats will only be calculated
1321 on those calls that match that filter.
1323 Example: B<-z rpc,srt,100003,3,nfs.fh.hash==0x12345678> will collect NFS v3
1324 SRT statistics for a specific file.
1326 =item B<-z> rtp,streams
1328 Collect statistics for all RTP streams and calculate max. delta, max. and
1329 mean jitter and packet loss percentages.
1331 =item B<-z> scsi,srt,I<cmdset>[,I<filter>]
1333 Collect call/reply SRT (Service Response Time) data for SCSI commandset I<cmdset>.
1335 Commandsets are 0:SBC 1:SSC 5:MMC
1338 is the number of calls for each procedure, MinSRT, MaxSRT and AvgSRT.
1340 Example: B<-z scsi,srt,0> will collect data for SCSI BLOCK COMMANDS (SBC).
1342 This option can be used multiple times on the command line.
1344 If the optional I<filter> is provided, the stats will only be calculated
1345 on those calls that match that filter.
1347 Example: B<-z scsi,srt,0,ip.addr==1.2.3.4> will collect SCSI SBC
1348 SRT statistics for a specific iscsi/ifcp/fcip host.
1350 =item B<-z> sip,stat[I<,filter>]
1352 This option will activate a counter for SIP messages. You will get the number
1353 of occurrences of each SIP Method and of each SIP Status-Code. Additionally
1354 you also get the number of resent SIP Messages (only for SIP over UDP).
1356 Example: B<-z sip,stat>.
1358 This option can be used multiple times on the command line.
1360 If the optional I<filter> is provided, the stats will only be calculated
1361 on those calls that match that filter.
1362 Example: B<-z "sip,stat,ip.addr==1.2.3.4"> will only collect stats for
1363 SIP packets exchanged by the host at IP address 1.2.3.4 .
1365 =item B<-z> smb,sids
1367 When this feature is used B<TShark> will print a report with all the
1368 discovered SID and account name mappings. Only those SIDs where the
1369 account name is known will be presented in the table.
1371 For this feature to work you will need to either to enable
1372 "Edit/Preferences/Protocols/SMB/Snoop SID to name mappings" in the
1373 preferences or you can override the preferences by specifying
1374 S<B<-o "smb.sid_name_snooping:TRUE">> on the B<TShark> command line.
1376 The current method used by B<TShark> to find the SID->name mapping
1377 is relatively restricted with a hope of future expansion.
1379 =item B<-z> smb,srt[,I<filter>]
1381 Collect call/reply SRT (Service Response Time) data for SMB. Data collected
1382 is number of calls for each SMB command, MinSRT, MaxSRT and AvgSRT.
1384 Example: B<-z smb,srt>
1386 The data will be presented as separate tables for all normal SMB commands,
1387 all Transaction2 commands and all NT Transaction commands.
1388 Only those commands that are seen in the capture will have its stats
1390 Only the first command in a xAndX command chain will be used in the
1391 calculation. So for common SessionSetupAndX + TreeConnectAndX chains,
1392 only the SessionSetupAndX call will be used in the statistics.
1393 This is a flaw that might be fixed in the future.
1395 This option can be used multiple times on the command line.
1397 If the optional I<filter> is provided, the stats will only be calculated
1398 on those calls that match that filter.
1400 Example: B<-z "smb,srt,ip.addr==1.2.3.4"> will only collect stats for
1401 SMB packets exchanged by the host at IP address 1.2.3.4 .
1403 =item --capture-comment E<lt>commentE<gt>
1405 Add a capture comment to the output file.
1407 This option is only available if a new output file in pcapng format is
1408 created. Only one capture comment may be set per output file.
1414 =head1 CAPTURE FILTER SYNTAX
1416 See the manual page of pcap-filter(7) or, if that doesn't exist, tcpdump(8),
1417 or, if that doesn't exist, L<http://wiki.wireshark.org/CaptureFilters>.
1419 =head1 READ FILTER SYNTAX
1421 For a complete table of protocol and protocol fields that are filterable
1422 in B<TShark> see the wireshark-filter(4) manual page.
1426 These files contains various B<Wireshark> configuration values.
1432 The F<preferences> files contain global (system-wide) and personal
1433 preference settings. If the system-wide preference file exists, it is
1434 read first, overriding the default settings. If the personal preferences
1435 file exists, it is read next, overriding any previous values. Note: If
1436 the command line option B<-o> is used (possibly more than once), it will
1437 in turn override values from the preferences files.
1439 The preferences settings are in the form I<prefname>B<:>I<value>,
1441 where I<prefname> is the name of the preference
1442 and I<value> is the value to
1443 which it should be set; white space is allowed between B<:> and
1444 I<value>. A preference setting can be continued on subsequent lines by
1445 indenting the continuation lines with white space. A B<#> character
1446 starts a comment that runs to the end of the line:
1448 # Capture in promiscuous mode?
1449 # TRUE or FALSE (case-insensitive).
1450 capture.prom_mode: TRUE
1452 The global preferences file is looked for in the F<wireshark> directory
1453 under the F<share> subdirectory of the main installation directory (for
1454 example, F</usr/local/share/wireshark/preferences>) on UNIX-compatible
1455 systems, and in the main installation directory (for example,
1456 F<C:\Program Files\Wireshark\preferences>) on Windows systems.
1458 The personal preferences file is looked for in
1459 F<$HOME/.wireshark/preferences> on
1460 UNIX-compatible systems and F<%APPDATA%\Wireshark\preferences> (or, if
1461 %APPDATA% isn't defined, F<%USERPROFILE%\Application
1462 Data\Wireshark\preferences>) on Windows systems.
1464 =item Disabled (Enabled) Protocols
1466 The F<disabled_protos> files contain system-wide and personal lists of
1467 protocols that have been disabled, so that their dissectors are never
1468 called. The files contain protocol names, one per line, where the
1469 protocol name is the same name that would be used in a display filter
1475 The global F<disabled_protos> file uses the same directory as the global
1478 The personal F<disabled_protos> file uses the same directory as the
1479 personal preferences file.
1481 =item Name Resolution (hosts)
1483 If the personal F<hosts> file exists, it is
1484 used to resolve IPv4 and IPv6 addresses before any other
1485 attempts are made to resolve them. The file has the standard F<hosts>
1486 file syntax; each line contains one IP address and name, separated by
1487 whitespace. The same directory as for the personal preferences file is
1490 Capture filter name resolution is handled by libpcap on UNIX-compatible
1491 systems and WinPcap on Windows. As such the Wireshark personal F<hosts> file
1492 will not be consulted for capture filter name resolution.
1494 =item Name Resolution (ethers)
1496 The F<ethers> files are consulted to correlate 6-byte hardware addresses to
1497 names. First the personal F<ethers> file is tried and if an address is not
1498 found there the global F<ethers> file is tried next.
1500 Each line contains one hardware address and name, separated by
1501 whitespace. The digits of the hardware address are separated by colons
1502 (:), dashes (-) or periods (.). The same separator character must be
1503 used consistently in an address. The following three lines are valid
1504 lines of an F<ethers> file:
1506 ff:ff:ff:ff:ff:ff Broadcast
1507 c0-00-ff-ff-ff-ff TR_broadcast
1508 00.00.00.00.00.00 Zero_broadcast
1510 The global F<ethers> file is looked for in the F</etc> directory on
1511 UNIX-compatible systems, and in the main installation directory (for
1512 example, F<C:\Program Files\Wireshark>) on Windows systems.
1514 The personal F<ethers> file is looked for in the same directory as the personal
1517 Capture filter name resolution is handled by libpcap on UNIX-compatible
1518 systems and WinPcap on Windows. As such the Wireshark personal F<ethers> file
1519 will not be consulted for capture filter name resolution.
1521 =item Name Resolution (manuf)
1523 The F<manuf> file is used to match the 3-byte vendor portion of a 6-byte
1524 hardware address with the manufacturer's name; it can also contain well-known
1525 MAC addresses and address ranges specified with a netmask. The format of the
1526 file is the same as the F<ethers> files, except that entries of the form:
1530 can be provided, with the 3-byte OUI and the name for a vendor, and
1533 00-00-0C-07-AC/40 All-HSRP-routers
1535 can be specified, with a MAC address and a mask indicating how many bits
1536 of the address must match. The above entry, for example, has 40
1537 significant bits, or 5 bytes, and would match addresses from
1538 00-00-0C-07-AC-00 through 00-00-0C-07-AC-FF. The mask need not be a
1541 The F<manuf> file is looked for in the same directory as the global
1544 =item Name Resolution (ipxnets)
1546 The F<ipxnets> files are used to correlate 4-byte IPX network numbers to
1547 names. First the global F<ipxnets> file is tried and if that address is not
1548 found there the personal one is tried next.
1550 The format is the same as the F<ethers>
1551 file, except that each address is four bytes instead of six.
1552 Additionally, the address can be represented as a single hexadecimal
1553 number, as is more common in the IPX world, rather than four hex octets.
1554 For example, these four lines are valid lines of an F<ipxnets> file:
1558 00:00:BE:EF IT_Server1
1561 The global F<ipxnets> file is looked for in the F</etc> directory on
1562 UNIX-compatible systems, and in the main installation directory (for
1563 example, F<C:\Program Files\Wireshark>) on Windows systems.
1565 The personal F<ipxnets> file is looked for in the same directory as the
1566 personal preferences file.
1570 =head1 ENVIRONMENT VARIABLES
1574 =item WIRESHARK_DEBUG_EP_NO_CHUNKS
1576 Normally per-packet memory is allocated in large "chunks." This behavior
1577 doesn't work well with debugging tools such as Valgrind or ElectricFence.
1578 Export this environment variable to force individual allocations.
1579 Note: disabling chunks also disables canaries (see below).
1581 =item WIRESHARK_DEBUG_SE_NO_CHUNKS
1583 Normally per-file memory is allocated in large "chunks." This behavior
1584 doesn't work well with debugging tools such as Valgrind or ElectricFence.
1585 Export this environment variable to force individual allocations.
1586 Note: disabling chunks also disables canaries (see below).
1588 =item WIRESHARK_DEBUG_EP_NO_CANARY
1590 Normally per-packet memory allocations are separated by "canaries" which
1591 allow detection of memory overruns. This comes at the expense of some extra
1592 memory usage. Exporting this environment variable disables these canaries.
1594 =item WIRESHARK_DEBUG_SE_USE_CANARY
1596 Exporting this environment variable causes per-file memory allocations to be
1597 protected with "canaries" which allow for detection of memory overruns.
1598 This comes at the expense of significant extra memory usage.
1600 =item WIRESHARK_DEBUG_SCRUB_MEMORY
1602 If this environment variable is set, the contents of per-packet and
1603 per-file memory is initialized to 0xBADDCAFE when the memory is allocated
1604 and is reset to 0xDEADBEEF when the memory is freed. This functionality is
1605 useful mainly to developers looking for bugs in the way memory is handled.
1607 =item WIRESHARK_DEBUG_WMEM_OVERRIDE
1609 Setting this environment variable forces the wmem framework to use the
1610 specified allocator backend for *all* allocations, regardless of which
1611 backend is normally specified by the code. This is mainly useful to developers
1612 when testing or debugging. See I<README.wmem> in the source distribution for
1615 =item WIRESHARK_RUN_FROM_BUILD_DIRECTORY
1617 This environment variable causes the plugins and other data files to be loaded
1618 from the build directory (where the program was compiled) rather than from the
1619 standard locations. It has no effect when the program in question is running
1620 with root (or setuid) permissions on *NIX.
1622 =item WIRESHARK_DATA_DIR
1624 This environment variable causes the various data files to be loaded from
1625 a directory other than the standard locations. It has no effect when the
1626 program in question is running with root (or setuid) permissions on *NIX.
1628 =item WIRESHARK_PYTHON_DIR
1630 This environment variable points to an alternate location for Python.
1631 It has no effect when the program in question is running with root (or setuid)
1632 permissions on *NIX.
1634 =item ERF_RECORDS_TO_CHECK
1636 This environment variable controls the number of ERF records checked when
1637 deciding if a file really is in the ERF format. Setting this environment
1638 variable a number higher than the default (20) would make false positives
1641 =item IPFIX_RECORDS_TO_CHECK
1643 This environment variable controls the number of IPFIX records checked when
1644 deciding if a file really is in the IPFIX format. Setting this environment
1645 variable a number higher than the default (20) would make false positives
1648 =item WIRESHARK_ABORT_ON_DISSECTOR_BUG
1650 If this environment variable is set, B<TShark> will call abort(3)
1651 when a dissector bug is encountered. abort(3) will cause the program to
1652 exit abnormally; if you are running B<TShark> in a debugger, it
1653 should halt in the debugger and allow inspection of the process, and, if
1654 you are not running it in a debugger, it will, on some OSes, assuming
1655 your environment is configured correctly, generate a core dump file.
1656 This can be useful to developers attempting to troubleshoot a problem
1657 with a protocol dissector.
1659 =item WIRESHARK_ABORT_ON_TOO_MANY_ITEMS
1661 If this environment variable is set, B<TShark> will call abort(3)
1662 if a dissector tries to add too many items to a tree (generally this
1663 is an indication of the dissector not breaking out of a loop soon enough).
1664 abort(3) will cause the program to exit abnormally; if you are running
1665 B<TShark> in a debugger, it should halt in the debugger and allow
1666 inspection of the process, and, if you are not running it in a debugger,
1667 it will, on some OSes, assuming your environment is configured correctly,
1668 generate a core dump file. This can be useful to developers attempting to
1669 troubleshoot a problem with a protocol dissector.
1671 =item WIRESHARK_EP_VERIFY_POINTERS
1673 This environment variable, if present, causes certain uses of pointers to be
1674 audited to ensure they do not point to memory that is deallocated after each
1675 packet has been fully dissected. This can be useful to developers writing or
1678 =item WIRESHARK_SE_VERIFY_POINTERS
1680 This environment variable, if present, causes certain uses of pointers to be
1681 audited to ensure they do not point to memory that is deallocated after when
1682 a capture file is closed. This can be useful to developers writing or
1685 =item WIRESHARK_ABORT_ON_OUT_OF_MEMORY
1687 This environment variable, if present, causes abort(3) to be called if certain
1688 out-of-memory conditions (which normally result in an exception and an
1689 explanatory error message) are experienced. This can be useful to developers
1690 debugging out-of-memory conditions.
1696 wireshark-filter(4), wireshark(1), editcap(1), pcap(3), dumpcap(1),
1697 text2pcap(1), mergecap(1), pcap-filter(7) or tcpdump(8)
1701 B<TShark> is part of the B<Wireshark> distribution. The latest version
1702 of B<Wireshark> can be found at L<http://www.wireshark.org>.
1704 HTML versions of the Wireshark project man pages are available at:
1705 L<http://www.wireshark.org/docs/man-pages>.
1709 B<TShark> uses the same packet dissection code that B<Wireshark> does,
1710 as well as using many other modules from B<Wireshark>; see the list of
1711 authors in the B<Wireshark> man page for a list of authors of that code.