# Suricata recursive traversal into sub directories in PCAP offline mode don't work

**URL:** <https://forum.suricata.io/t/suricata-recursive-traversal-into-sub-directories-in-pcap-offline-mode-dont-work/3273>\
**Category:** Help\
**Tags:** suricata\
**Created:** [February 28, 2023, 7:33am UTC](https://forum.suricata.io/t/suricata-recursive-traversal-into-sub-directories-in-pcap-offline-mode-dont-work/3273 "2023-02-28T07:33:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jackojack7](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Jackojack7](https://forum.suricata.io/u/Jackojack7)\
**Post date:** [February 28, 2023, 7:33am UTC](https://forum.suricata.io/t/suricata-recursive-traversal-into-sub-directories-in-pcap-offline-mode-dont-work/3273/1 "2023-02-28T07:33:32Z")

</div>

Hey,

I have a PCAPs directory which has many subdirectories within it.

I try to run Suricata in PCAP offline mode with the `--pcap-file-recursive` in order to read all the PCAPs within the sub directories but it seems Suricata only scans the PCAPs in the parent directory and ignores the subdirectories.

I run this command:  
`suricata -r pcaps --pcap-file-recursive -k none`

For the purpose of testing, my `pcaps` directory consists of 1 PCAP and 1 directory with PCAP inside it. When I run Suricata with the command above it only read 1 PCAP:

> 28/2/2023 – 09:30:17 - - all 9 packet processing threads, 4 management threads initialized, engine started.  
> 28/2/2023 – 09:30:17 - - Starting directory run for pcaps  
> 28/2/2023 – 09:30:17 - - Processing pcaps directory pcaps, files must be newer than 0 and older than 18446744073709550616  
> 28/2/2023 – 09:30:17 - - Found “pcaps/dec.pcap” at 1662289543000  
> 28/2/2023 – 09:30:17 - - pcap file pcaps/dec.pcap end of file reached (pcap err code 0)  
> 28/2/2023 – 09:30:17 - - Processed file pcaps/dec.pcap, processed up to 1662289543000  
> 28/2/2023 – 09:30:17 - - Updating processed to 1662289543000  
> 28/2/2023 – 09:30:17 - - Directory run mode complete  
> 28/2/2023 – 09:30:17 - - Signal Received. Stopping engine.  
> 28/2/2023 – 09:30:17 - - 0 new flows, 0 established flows were timed out, 0 flows in closed state  
> 28/2/2023 – 09:30:17 - - time elapsed 0.124s  
> 28/2/2023 – 09:30:17 - - 2 flows processed  
> 28/2/2023 – 09:30:17 - - Pcap-file module read 1 files, 4 packets, 1424 bytes

My Suricata version is 6.0.6.

---

<div class="post-metadata">

**Author:** ![Andreas\_Herz](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/andreas_herz/32/52_2.png) [@Andreas\_Herz](https://forum.suricata.io/u/Andreas_Herz)\
**Post date:** [February 28, 2023, 8:15am UTC](https://forum.suricata.io/t/suricata-recursive-traversal-into-sub-directories-in-pcap-offline-mode-dont-work/3273/2 "2023-02-28T08:15:10Z")

</div>

Hi I can confirm that this seems to be broken, also with 6.0.10 and 7.0.0-rc1. See this redmine ticket I created for the tracking:

> **[Bug #5880: pcap recursive mode not working as expected - Suricata - Open...](https://redmine.openinfosecfoundation.org/issues/5880)**
>
> Redmine
