diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2017-06-16 15:19:18 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-06-22 19:31:01 +0000 |
commit | 07f576ffeb2bfabecaefbe24088a2858f47d4642 (patch) | |
tree | ee51b1043b254b4b86b8422c5e86d643c81d8cf8 /doc | |
parent | 2954a69d7d5627bf330eb9bb05eb5a1274e01f3a (diff) | |
download | wireshark-07f576ffeb2bfabecaefbe24088a2858f47d4642.tar.gz wireshark-07f576ffeb2bfabecaefbe24088a2858f47d4642.tar.bz2 wireshark-07f576ffeb2bfabecaefbe24088a2858f47d4642.zip |
Add --no-duplicate-keys tshark option.
Adds the --no-duplicate-keys option to tshark. If -T json is specified,
this option can be specified in order to transform the duplicate keys
produced by -T json into single keys with as value a json array of all
separate values.
Specifying --no-duplicate-keys changes the function which groups node
children that is passed to write_json_proto_tree. Instead of a function
that puts each node in a separate group (proto_node_group_children_by_unique)
a function is passed that groups children that have the same json key
together (proto_node_group_children_by_json_key). This will lead to
some groups having multiple values. Groups with multiple values are
written to the output as a json array. This includes normal json keys
but also keys with the "_raw" and "_tree" suffix.
If --no-duplicate-keys is specified with an option other than "-T json"
or "-T jsonraw" or without -T an error is shown and tshark will exit.
"Export Packet Dissections -> As JSON" in the GUI is hardcoded to use
the duplicated keys format.
Fixes one regression in the output where a filtered json key (-j) with
both a value and children would not have the "_tree" suffix added to the
json key containing the children.
Includes a little code cleanup (removes one instance of code
duplication and simplifies a while loop).
Fixes a memory leak (I thought this fix was already included in the
previous refactor patch but something must have gone wrong when updating
the patch so I'm including it again in this patch).
Bug: 12958
Change-Id: I401f8fc877b5c590686567c3c44cdb832e9e7dfe
Reviewed-on: https://code.wireshark.org/review/22166
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/tshark.pod | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/tshark.pod b/doc/tshark.pod index 208d6cc44e..9cde4e4fea 100644 --- a/doc/tshark.pod +++ b/doc/tshark.pod @@ -55,6 +55,7 @@ S<[ B<-M> E<lt>auto session resetE<gt> ]> S<[ B<-z> E<lt>statisticsE<gt> ]> S<[ B<--capture-comment> E<lt>commentE<gt> ]> S<[ B<--color> ]> +S<[ B<--no-duplicate-keys> ]> S<[ B<--export-objects> E<lt>protocolE<gt>,E<lt>destdirE<gt> ]> S<[ B<--enable-protocol> E<lt>proto_nameE<gt> ]> S<[ B<--disable-protocol> E<lt>proto_nameE<gt> ]> @@ -1626,6 +1627,12 @@ are not supported by all terminal emulators. See L<https://wiki.wireshark.org/ColoringRules> for more information on configuring color filters. +=item --no-duplicate-keys + +If a key appears multiple times in an object, only write it a single time with +as value a json array containing all the separate values. (Only works with +-T json) + =item --export-objects E<lt>protocolE<gt>,E<lt>destdirE<gt> Export all objects within a protocol into directory B<destdir>. The available |