Hi again guys!
I'm making a little C# code to export expanded PCAP files to a Database.
So far I have succeeded in creating the JSON, however, I noticed that a very nice Wireshark column, _ws.col.Info, is missing on the generated file.
This column would contain very important information for Camel analysis, for example "SACK invoke InitialDP","invoke eventReportBCSM",""SACK invoke release call", among others.
On previous projects where I was required to export the PCAP as I CSV, I was able to do so by using switches like the following one:
-e frame.number -e frame.time -e _ws.col.Info -e diameter.Session-Id -e e164.msisdn -e e212.imsi
However, I'm not very sure how to do that on a generated .JSON
This is part of the code I came up with, if anybody finds it useful
String fileNameWithoutExtension = Path.GetFileNameWithoutExtension(pcapFilePath);
String fileNameWithExtension = Path.GetFileName(pcapFilePath);
String workingFolder = pcapFilePath.Replace(fileNameWithExtension, "");
String pcapToFilteredPcapArguments = "-r \"" + pcapFilePath + "\" -Y camel -w \"" + workingFolder + fileNameWithoutExtension + "_filtered.pcap\"";
String output = await new UtilsIO().executeExe(SHARK_INSTALL_FOLDER, pcapToFilteredPcapArguments);
Console.WriteLine(output);
Console.WriteLine("Filtered PCAP ready...");
String temporaryPcapFilename = "\"" + workingFolder + fileNameWithoutExtension + "_filtered.pcap\"";
String JsonFilePath = workingFolder + fileNameWithoutExtension + ".json";
Console.WriteLine("Generating JSON...");
String pcapToJsonArguments = "-r " + temporaryPcapFilename + " -T json ";
String consoleOutputFromPcapToJson = await new UtilsIO().executeExe(SHARK_INSTALL_FOLDER, pcapToJsonArguments);
UtilsIO.saveTextFile(consoleOutputFromPcapToJson, JsonFilePath);
Console.WriteLine("JSON Ready...");
As always thank you very much!