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

how can I stop capturing wireshark logs using tshark from the command line ?

  • retag add tags

I want to Start capturing wireshark logs using tshark from the command line and save it in a txt file:

tshark -T text >C:/Nokia/Capture.txt.

My question is: how can I stop it?

Can I put an argument to collect just for one minute?

Ramona Rusu's avatar
1
Ramona Rusu
asked 2019-10-16 06:32:07 +0000
grahamb's avatar
23.8k
grahamb
updated 2019-10-16 09:38:01 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Please use the option, -a condition to stop, by time, or number of files, file size, example by time:

-a duration:time in seconds (60 seconds) -a duration:60

with a buffer for the files (desired) to stop the capture after a certain time. Text files will not be the best recommended option for saving the output, but pcap/pcapng as default standard file format, you may create a CSV file instead with tshark, or transform them later using editcap tool in other format Ex. editcap -F , look the info page

tshark -i 1 -b filesize:175000 -b files:526 -a duration:3600 -w I:\Wiresharklogs\output1.pcapng

also better with the dumpcap command, which is on your wireshark installation as well, tshark is calling dumpcap in any case

dumpcap -i 1 -b filesize:175000 -b files:526 -a duration:3600 -w I:\Wiresharklogs\output1.pcapng

for writting a CSV file with tshark look at this question

xinxolHH's avatar
13
xinxolHH
answered 2019-10-16 07:33:55 +0000, updated 2019-10-16 12:19:42 +0000
edit flag offensive 0 remove flag delete link

Comments

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