# Regenerate Packets From EK format

**URL:** https://discuss.elastic.co/t/regenerate-packets-from-ek-format/196639
**Category:** Elasticsearch
**Created:** [August 24, 2019, 10:11pm UTC](https://discuss.elastic.co/t/regenerate-packets-from-ek-format/196639 "2019-08-24T22:11:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![baig](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@baig](https://discuss.elastic.co/u/baig)
#### Post date: [August 24, 2019, 10:11pm UTC](https://discuss.elastic.co/t/regenerate-packets-from-ek-format/196639/1 "2019-08-24T22:11:49Z")

</div>

Hi, I have a framework for packet analysis that I have built on ELK stack. Mainly, I have been using this for network traces analysis and monitoring. There is one issue that I have been struggling and that may not be related to Elasticsearch but I wanted to give it a try.  
I am ingesting EK format packet data into Elasticsearch along with Hex data using the following command  
tshark -T ek -x -r packetfile.pcap \>\> outfile

I want to use this data to re-generate the original packetfile.pcap.

I have exhausted many forums related to wireshark and unix community to work on this pipeline but I am unable to find an efficient solution to do so. Currently, I am saving the Hex data separately for the same ID as generated by  
tshark -x -r packetfile.pcap \>\> hex.txt and ingesting to ES. But the problem with this is, it doesn't save the timestamps along. So I have to save timestamps separate and then insert the timestamps into hex.txt for each header of a packet HEX. I know this is not a good way to achieve this as it takes forever to insert timestamps into hex.txt if there are for example 10000 packets info in hex.txt.  
Is there a simpler way to regenerate packet with original timestamps of each frame saved in ES?

Thank you in advance!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 21, 2019, 10:11pm UTC](https://discuss.elastic.co/t/regenerate-packets-from-ek-format/196639/2 "2019-09-21T22:11:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
