If the packet doesn't have a http.user_agent field, don't dump any data. If the packet does have a http.user_agent field, dump the IP address and the http.user_agent field information as follows: tshark -r -w File1.pcapng -T fields -e ip.src -e http.user_agent -w File1.pcapng But it's not doing what I want. Any suggestions as to how to get it to work. FWIW asked 24 Jul '16, 22:38 wbenton |
One Answer:
Add The protocol fields specified using answered 25 Jul '16, 22:30 sindy That did it... Thanks! (26 Jul '16, 19:15) wbenton |
For starters remove the first '-W File1.pcapng' and replace with the filename you intend to read (not being File1.pcapng).
Sorry about that, when I renamed the actual file with a temporary filename, I guess I replaced too much.
The following is actually what I was trying:
tshark -r File1.pcapng -T fields -e ip.src -e http.user_agent -w File1.txt
But it outputs IP source for fields which don't have any http.user_agent field in it as well.
I only want output for fields which have the http.user_agent field in them... not for every single packet.
Any advice on how to do that?