# File Extraction Directory

**URL:** <https://community.zeek.org/t/file-extraction-directory/3241>\
**Category:** Zeek\
**Created:** [August 27, 2014, 9:38pm UTC](https://community.zeek.org/t/file-extraction-directory/3241 "2014-08-27T21:38:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Batchelor](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jason\_Batchelor](https://community.zeek.org/u/Jason_Batchelor)\
**Post date:** [August 27, 2014, 9:38pm UTC](https://community.zeek.org/t/file-extraction-directory/3241/1 "2014-08-27T21:38:29Z")

</div>

Hello all:

Quick question, can you change the default file extraction directory for files being extracted in a script. After some poking I came across where this was specified in /opt/bro/share/bro/base/files/extract/main.bro with the following:

export {

## The prefix where files are extracted to.

const prefix = “./extract\_files/” &redef;

If I try to do something like this in my script:

# Set extraction folder

redef prefix = “/var/opt/bro/spool/extract\_files”;

I am met with the following:  
error in ./scripts/file-ext.bro, line 22: “redef” used but not previously defined (prefix)  
internal warning in ./scripts/file-ext.bro, line 22: Can’t document redef of prefix, identifier lookup failed

Can someone help me understand how to define this attribute or otherwise influence where the files are extracted to? I would rather not manually define it in the main.bro file.

Thanks,  
Jason

---

<div class="post-metadata">

**Author:** ![Siwek\_Jon](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@Siwek\_Jon](https://community.zeek.org/u/Siwek_Jon)\
**Post date:** [August 27, 2014, 10:01pm UTC](https://community.zeek.org/t/file-extraction-directory/3241/2 "2014-08-27T22:01:47Z")

</div>

It’s missing the namespace scoping, try using “FileExtract::prefix”.

- Jon

---

<div class="post-metadata">

**Author:** ![johanna](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@johanna](https://community.zeek.org/u/johanna)\
**Post date:** [August 27, 2014, 10:07pm UTC](https://community.zeek.org/t/file-extraction-directory/3241/3 "2014-08-27T22:07:50Z")

</div>

Hi,

redef FileExtract::prefix = "/var/opt/bro/spool/extract\_files/"; should work.

Johanna

---

<div class="post-metadata">

**Author:** ![Jason\_Batchelor](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jason\_Batchelor](https://community.zeek.org/u/Jason_Batchelor)\
**Post date:** [August 29, 2014, 8:00pm UTC](https://community.zeek.org/t/file-extraction-directory/3241/4 "2014-08-29T20:00:00Z")

</div>

That’s it 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:42pm UTC](https://community.zeek.org/t/file-extraction-directory/3241/5 "2022-05-06T15:42:01Z")

</div>


