fix missing fields for json, ek and pdml when used with -e fields
authorHessam Jalali <hessam.jalali@gmail.com>
Thu, 30 Jun 2016 17:11:15 +0000 (21:41 +0430)
committerPascal Quantin <pascal.quantin@gmail.com>
Fri, 1 Jul 2016 15:48:41 +0000 (15:48 +0000)
commitf3bd70b246a95c7762c3710afa728f646cafa08f
tree0e8c307e2e741c4be21dda2f3c373e4c2578fa44
parentad309999fdff362bbc16dc183ade5103c6a83048
fix missing fields for json, ek and pdml when used with -e fields

Description:

when -T json,ed or pdml used in conjunction with -e fields they would
always miss  the last field.

in case of json and ek, if some fields in the middle are empty,
the generated json would be invalid.

sample for ek:

 {  "_index": "packets-2016-06-30",  "_type": "pcap_file",
 "_score": null,  "_source":
 {  "layers": {  "e212.mcc": ["255","262"]  "frame.time_epoch":
 ["1426550400.004751510"],  "e212.mnc": ["1","1"]  }  }  }

command:

tshark -T ek -r C:\a.pcap -e e212.mcc -e frame.comment
-e frame.time_epoch -e e212.mnc > C:\test.json

note:

the comma is missing between e212.mcc and frame.time_epoch

Change-Id: I2efae0c48036cf6313e2a064453c8dbc49f38b09
Reviewed-on: https://code.wireshark.org/review/16226
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Kacer <kacer.martin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
epan/print.c