# Reading packet from a lot of .pcap file?

**URL:** <https://discuss.elastic.co/t/reading-packet-from-a-lot-of-pcap-file/117746>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [January 31, 2018, 6:59am UTC](https://discuss.elastic.co/t/reading-packet-from-a-lot-of-pcap-file/117746 "2018-01-31T06:59:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangyufeng0615](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@wangyufeng0615](https://discuss.elastic.co/u/wangyufeng0615)\
**Post date:** [January 31, 2018, 6:59am UTC](https://discuss.elastic.co/t/reading-packet-from-a-lot-of-pcap-file/117746/1 "2018-01-31T06:59:16Z")

</div>

Hello everyone,

I have a lot of .pcap file in one folder (~10,000). I want import this data to elasticsearch.

As I know, flag "-I" can import just one .pcap file at one time.

Is there any way I can do this? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [January 31, 2018, 4:06pm UTC](https://discuss.elastic.co/t/reading-packet-from-a-lot-of-pcap-file/117746/2 "2018-01-31T16:06:23Z")

</div>

@wangyufeng0615 Not out of the box, we mostly use `-I` for development purpose, but you can write a simple shell script to loop through all the files.

Also make sure you use -t, so packetbeat read the file as fast as possible.

```auto
  -t, --t Read packets as fast as possible, without sleeping

```

---

<div class="post-metadata">

**Author:** ![wangyufeng0615](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@wangyufeng0615](https://discuss.elastic.co/u/wangyufeng0615)\
**Post date:** [February 1, 2018, 5:04am UTC](https://discuss.elastic.co/t/reading-packet-from-a-lot-of-pcap-file/117746/3 "2018-02-01T05:04:17Z")

</div>

Thank you for you advice! @pierhugues  
I will try to write a shell script.

---

<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:** [March 1, 2018, 5:04am UTC](https://discuss.elastic.co/t/reading-packet-from-a-lot-of-pcap-file/117746/4 "2018-03-01T05:04:38Z")

</div>

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