First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Why does "tshark -b packets:value" not work?

Hello,experts

    On Windows 10, using tshark, why does "tshark -b packets:value" not work?

    "tshark -b packets:1000 -w test.pcapng"  or  "tshark -b packets:1000 -b files:3 -w test.pcapng"
    tshark: Multiple capture files requested, but no maximum capture file size, duration or interval was specified.

    tshark version
    TShark (Wireshark) 3.4.6 (v3.4.6-0 - g6357ac1405b8))

Regards, 7ACE

7ACE's avatar
40
7ACE
asked 2021-07-04 02:29:04 +0000
edit flag offensive 0 remove flag close merge delete

Comments

I can't answer your question why it's not possible to do a multiple file capture based on the count of packets only. From my understanding this should work as expected. Maybe a bug?

But as the error message says: just add a maximum file size, duration or interval to your command and it will work. Select a high value so that the packet counter will take in place first.

tshark -b duration:100000 -b packets:100 -w test.pcap
JasMan's avatar JasMan (2021-07-04 10:33:56 +0000) edit

Thank you for the answer!

7ACE's avatar 7ACE (2021-07-05 00:20:12 +0000) edit
add a comment see more comments

1 Answer

0

This looks like a bug in tshark (global_capture_opts.has_file_packets check missing at line 1775).

You can report this at the Wireshark issues list https://gitlab.com/wireshark/wireshar... .

When capturing to file just use dumpcap instead of thshark, with same command line options. All tshark does here is calling dumpcap to do the capturing.

André's avatar
176
André
answered 2021-07-04 12:45:45 +0000
edit flag offensive 0 remove flag delete link

Comments

Chuckc's avatar Chuckc (2021-07-04 17:14:43 +0000) edit

bug fix merged into master. https://gitlab.com/wireshark/wireshar...

As mentioned "-b packets:value" already works with current version of dumpcap.

André's avatar André (2021-07-04 21:23:49 +0000) edit

Thanks guys !

7ACE's avatar 7ACE (2021-07-05 00:21:27 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer