# Filename in bro script

**URL:** <https://community.zeek.org/t/filename-in-bro-script/2996>\
**Category:** Zeek\
**Created:** [February 11, 2014, 6:15pm UTC](https://community.zeek.org/t/filename-in-bro-script/2996 "2014-02-11T18:15:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio\_Nappa](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Antonio\_Nappa](https://community.zeek.org/u/Antonio_Nappa)\
**Post date:** [February 11, 2014, 6:15pm UTC](https://community.zeek.org/t/filename-in-bro-script/2996/1 "2014-02-11T18:15:10Z")

</div>

Hi guys,

just a quick question, when I call bro with: bro myscript.bro -r file.pcap is there a way to have the file.pcap string passed as a variable or parameter inside the script?

Thank you

Antonio Nappa

---

<div class="post-metadata">

**Author:** ![anthony\_kasza1](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@anthony\_kasza1](https://community.zeek.org/u/anthony_kasza1)\
**Post date:** [February 11, 2014, 11:12pm UTC](https://community.zeek.org/t/filename-in-bro-script/2996/2 "2014-02-11T23:12:34Z")

</div>

I’ve looked for this feature as well and have not been able to locate it. It would be nice to have a @PKTSOURCE variable similar to the @FILENAME and @DIR variables.

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [February 12, 2014, 12:32am UTC](https://community.zeek.org/t/filename-in-bro-script/2996/3 "2014-02-12T00:32:16Z")

</div>

Yeah, that information is not currently available. Can you guys say a  
bit more about the use case(s) here?

I'm asking because we could either make it available directly (that  
should be pretty straight-forward) or cover it implicitly by exposing  
all command line parameters to script-land, along with some library  
functionality to parse them easily (which Seth is rooting for 🙂

In any case, please file a feature request ticket.

Robin

---

<div class="post-metadata">

**Author:** ![anthony\_kasza1](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@anthony\_kasza1](https://community.zeek.org/u/anthony_kasza1)\
**Post date:** [February 12, 2014, 4:06am UTC](https://community.zeek.org/t/filename-in-bro-script/2996/4 "2014-02-12T04:06:45Z")

</div>

Submitted here \<[https://bro-tracker.atlassian.net/browse/BIT-1131](https://bro-tracker.atlassian.net/browse/BIT-1131)\>. Is  
this the preferred method for submitting feature requests instead of  
posting to this list?

-AK

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [February 12, 2014, 4:17am UTC](https://community.zeek.org/t/filename-in-bro-script/2996/5 "2014-02-12T04:17:27Z")

</div>

Yes, for a specific feature that's the best way to make sure it gets  
recorded. But it's fine to discuss on the list first if you are  
looking for further input/ideas.

Robin

---

<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:41pm UTC](https://community.zeek.org/t/filename-in-bro-script/2996/6 "2022-05-06T15:41:34Z")

</div>


