Lets say if i want to capture the wireshark capture GUI column data live to a windows txt file using tshark. The tshark command will be like this :
asked 24 Apr '12, 18:38 misteryuku edited 30 Apr '12, 07:10 grahamb ♦ |
2 Answers:
You're assuming that the Dissected packet information is written to the standard output, which is not necessarily being written to a file; even if it happens to be written to a file, TShark has no control over the file - it just gets its standard output redirected to a file by the program that runs it - probably You would have to pipe the output of TShark to another program; that program could, for example, be given an argument specifying the path to the directory into which to write the files and part of the name to be given to the files, and could read its standard input and write it to a file and, when that file reaches its maximum size, close that file, open a new file, and continue writing its standard input to the new file. I don't know whether any such programs already exist, either for UN*X or Windows; if not, you might have to write it. answered 25 Apr '12, 12:16 Guy Harris ♦♦ I wanted the output as the wireshark GUI column data when i call this tshark command tshark -i your_interface -n > your _path _to _text _file. So if that kind of text output were to be generated form tshark, then can i also pipe the text output from the tshark command tshark -i your_interface -n > your _path _to _text _file to another program instead of piping the standard output?? (25 Apr '12, 20:07) misteryuku If you're piping the output from tshark, there's no
That will write the column data (as you haven't used the (26 Apr '12, 09:36) Guy Harris ♦♦ |
to hand over the capture files you will have to implement a "directory watcher" in java, that fires every time a new file is created in your working directory. tshark itself will not tell your external java programm when it creates a new "rolling" capture file. You can find some information about a "directory watcher" in java here: http://docs.oracle.com/javase/tutorial/essential/io/notification.html I think you will get further information in a java programmer forum. BTW: Why not using a libpcap wrapper in java altogether, instead of tshark? jNetPcap Jpcap Regards answered 30 Apr '12, 09:18 Kurt Knochner ♦ |
Modifying your question so heavily that the previous answers barely make sense isn't the correct way to use this site. Minor edits to clarify things are acceptable.
You ask a question, others answer it, you then accept all answers that solve your issue so that others who have a similar question can see the answers given that helped you and help themselves.
If you have another question, then please create a new one, so that the the correct answers will appear after it.
I have reverted your question to its original state.