tshark -T ek: export certain fields including frame_raw doesnt work
Hey folks, I've spent quite a lot of time braining this out, but I can't seem to figure out how to solve the Problem.
I need certain fields like
eth.dst
eth.dst_resolved
but ( for example) not
eth.src
eth.src_resolved
plus I need the frame_raw (-x flag), but when I use this command it does not work:
tshark -T ek -e eth.dst -e eth.dst_resolved -e... -e... -x -r ../caps/trace_00049_20191116001454.pcap
The output does not contain the frame_raw / -x.
When I use the -J option (to export as json), I use this command:
tshark -T ek -J "ip" -x -r ...
I cannot figure out how to convert my filters from "wireshark" terminology to the required terminology for json.
-J "ip" gives me everything in layers.ip, and I cannot narrow it down. Any ideas?
It would be nice if there was a
frame.data
orframe.payload
field to include but I haven't found a field that would give all the packet bytes.The man page seems to say that hex is only available for the summary or details so when individual fields are picked with "-e" that doesn't apply.
Are you open to making two passes through, joining the data on timestamp and massaging into a form you can use?
(more)I took the fields/field names from these docs, they are great, but they don't show the json filters, which is bad.
https://www.wireshark.org/docs/dfref/...
Now, I am kinda bound to speed, I am capturing with a remote interface on windows, storing the ringbuffer files to a share and import them to kibana on linux. Currently I am trying two ways to get only what I want:
wireshark fields filter, and a python script th build a new json object from the loaded json object, but both don't work 100%.
With two passes, you mean storing the fields in one file, and then running tshark -r file -T ek -x to store the raw data in another file, to later merge them?
I am afraid this adds too much complexity to the scripts (when merging) and runs longer.
I wish there was a way to ...(more)
https://ask.wireshark.org/question/11...
(more)If you don't need the whole frame its possible to turn off dissection for the upper layers and grab
data.data
.