4 capinfos - Prints information about capture files
49 B<Capinfos> is a program that reads one or more capture files and
50 returns some or all available statistics (infos) of each E<lt>I<infile>E<gt>
51 in one of two types of output formats: long or table.
53 The long output is suitable for a human to read. The table output
54 is useful for generating a report that can be easily imported into
55 a spreadsheet or database.
57 The user specifies what type of output (long or table) and which
58 statistics to display by specifying flags (options) that corresponding
59 to the report type and desired infos. If no options are specified,
60 B<Capinfos> will report all statistics available in "long" format.
62 Options are processed from left to right order with later options
63 superseding or adding to earlier options.
65 B<Capinfos> is able to detect and read the same capture files that are
66 supported by B<Wireshark>.
67 The input files don't need a specific filename extension; the file
68 format and an optional gzip compression will be automatically detected.
69 Near the beginning of the DESCRIPTION section of wireshark(1) or
70 L<https://www.wireshark.org/docs/man-pages/wireshark.html>
71 is a detailed description of the way B<Wireshark> handles this, which is
72 the same way B<Capinfos> handles this.
80 Displays the start time of the capture. B<Capinfos> considers
81 the earliest timestamp seen to be the start time, so the
82 first packet in the capture is not necessarily the earliest -
83 if packets exist "out-of-order", time-wise, in the capture,
84 B<Capinfos> detects this.
88 Generate all infos. By default capinfos will display
89 all infos values for each input file, but enabling
90 any of the individual display infos options will
91 disable the generate all option.
95 Separate infos with ASCII SPACE (0x20) characters.
96 This option is only useful when generating a table
97 style report (-T). The various info values will be
98 separated (delimited) from one another with a single
99 ASCII SPACE character.
101 NOTE: Since some of the header labels as well as some
102 of the value fields contain SPACE characters. This
103 option is of limited value unless one of the quoting
104 options (-q or -Q) is also specified.
108 Separate the infos with ASCII TAB characters.
109 This option is only useful when generating a table
110 style report (-T). The various info values will be
111 separated (delimited) from one another with a single
112 ASCII TAB character. The TAB character is the default
113 delimiter when -T style report is enabled.
117 Displays the number of packets in the capture file.
121 Cancel processing any additional files if and
122 when capinfos should fail to open an input file.
123 By default capinfos will attempt to open each and
124 every file name argument.
126 Note: An error message will be written to stderr
127 whenever capinfos fails to open a file regardless
128 of whether the -C option is specified or not.
129 Upon exit, capinfos will return an error status
130 if any errors occurred during processing.
134 Displays the total length of all packets in the file, in
135 bytes. This counts the size of the packets as they appeared
136 in their original form, not as they appear in this file.
137 For example, if a packet was originally 1514 bytes and only
138 256 of those bytes were saved to the capture file (if packets
139 were captured with a snaplen or other slicing option),
140 B<Capinfos> will consider the packet to have been 1514 bytes.
144 Displays the end time of the capture. B<Capinfos> considers
145 the latest timestamp seen to be the end time, so the
146 last packet in the capture is not necessarily the latest -
147 if packets exist "out-of-order", time-wise, in the capture,
148 B<Capinfos> detects this.
152 Displays the per-file encapsulation of the capture file.
156 Displays additional capture file information.
160 Prints the help listing and exits.
164 Displays the SHA256, RIPEMD160, and SHA1 hashes for the file.
165 SHA1 output may be removed in the future.
169 Displays the average data rate, in bits/sec
173 Displays detailed capture file interface information. This information
174 is not available in table format.
178 Displays the capture comment. For pcapng files, this is the comment from the
179 section header block.
183 Use this option to suppress printing capture comments. By default capture
184 comments are enabled. Capture comments are relatively freeform and might
185 contain embedded new-line characters and/or other delimiting characters
186 making it harder for a human or machine to easily parse the capinfos output.
187 Excluding capture comments can aid in post-processing of output.
191 Display the snaplen (if any) for a file.
192 snaplen (if available) is determined from the capture file header
193 and by looking for truncated records in the capture file.
197 Generate long report. Capinfos can generate two
198 different styles of reports. The "long" report is
199 the default style of output and is suitable for a
204 Separate the infos with comma (,) characters. This option
205 is only useful when generating a table style report (-T).
206 The various info values will be separated (delimited)
207 from one another with a single comma "," character.
211 Print raw (machine readable) numeric values in long reports.
212 By default capinfos prints human-readable values with SI
213 suffixes. Table reports (-T) always print raw values.
217 Do not quote the infos. This option is only useful
218 when generating a table style report (-T). Excluding
219 any quoting characters around the various values and
220 using a TAB delimiter produces a very "clean" table
221 report that is easily parsed with CLI tools. By
222 default infos are B<NOT> quoted.
226 Displays "True" if packets exist in strict chronological order
227 or "False" if one or more packets in the capture exists
228 "out-of-order" time-wise.
232 Quote infos with single quotes ('). This option is
233 only useful when generating a table style report (-T).
234 When this option is enabled, each value will be
235 encapsulated within a pair of single quote (')
236 characters. This option (when used with the -m
237 option) is useful for generating one type of CSV
242 Quote infos with double quotes ("). This option is
243 only useful when generating a table style report (-T).
244 When this option is enabled, each value will be
245 encapsulated within a pair of double quote (")
246 characters. This option (when used with the -m
247 option) is useful for generating the most common
248 type of CSV style file report.
252 Do not generate header record. This option is only
253 useful when generating a table style report (-T).
254 If this option is specified then B<no> header record will be
255 generated within the table report.
259 Generate header record. This option is only useful
260 when generating a table style report (-T). A header
261 is generated by default. A header record (if generated)
262 is the first line of data reported and includes labels
263 for all the columns included within the table report.
267 Displays the size of the file, in bytes. This reports
268 the size of the capture file itself.
272 Display the start and end times as seconds since January
273 1, 1970. Handy for synchronizing dumps using B<editcap -t>.
277 Displays the capture type of the capture file.
281 Generate a table report. A table report is a text file
282 that is suitable for importing into a spreadsheet or
283 database. Capinfos can build a tab delimited text file
284 (the default) or several variations on Comma-separated
289 Displays the capture duration, in seconds. This is the
290 difference in time between the earliest packet seen and
295 Displays the tool's version and exits.
299 Displays the average packet rate, in packets/sec
303 Displays the average data rate, in bytes/sec
307 Displays the average packet size, in bytes
313 To see a description of the capinfos options use:
317 To generate a long form report for the capture file
320 capinfos mycapture.pcap
322 To generate a TAB delimited table form report for the capture
323 file mycapture.pcap use:
325 capinfos -T mycapture.pcap
327 To generate a CSV style table form report for the capture
328 file mycapture.pcap use:
330 capinfos -T -m -Q mycapture.pcap
334 capinfos -TmQ mycapture.pcap
337 To generate a TAB delimited table style report with just the
338 filenames, capture type, capture encapsulation type and packet
339 count for all the pcap files in the current directory use:
341 capinfos -T -t -E -c *.pcap
345 capinfos -TtEs *.pcap
347 Note: The ability to use of filename globbing characters are
348 a feature of *nix style command shells.
350 To generate a CSV delimited table style report of all infos
351 for all pcap files in the current directory and write it to
352 a text file called mycaptures.csv use:
354 capinfos -TmQ *.pcap >mycaptures.csv
356 The resulting mycaptures.csv file can be easily imported
357 into spreadsheet applications.
361 pcap(3), wireshark(1), mergecap(1), editcap(1), tshark(1),
362 dumpcap(1), pcap-filter(7) or tcpdump(8)
366 B<Capinfos> is part of the B<Wireshark> distribution. The latest version
367 of B<Wireshark> can be found at L<https://www.wireshark.org>.
369 HTML versions of the Wireshark project man pages are available at:
370 L<https://www.wireshark.org/docs/man-pages>.
376 Ian Schorr <ian[AT]ianschorr.com>
381 Gerald Combs <gerald[AT]wireshark.org>
382 Jim Young <jyoung[AT]gsu.edu>