# Optional Internal Values - Bro 2.0

**URL:** <https://community.zeek.org/t/optional-internal-values-bro-2-0/2160>\
**Category:** Zeek\
**Created:** [December 16, 2011, 4:21pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160 "2011-12-16T16:21:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Swaro](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@James\_Swaro](https://community.zeek.org/u/James_Swaro)\
**Post date:** [December 16, 2011, 4:21pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160/1 "2011-12-16T16:21:50Z")

</div>

Just to clarify something that I couldn’t find in the documentation.

Optional Internal values can be set as arguments,

> Ex. bro -Cr somefile.trace some/policy/here myvar=somevalue

as well as at the script level,

> Ex. redef myvar = somevalue;

Correct?

It seems I cannot get the script level value to set, but the command line argument is correctly set.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Bianco\_David\_GE\_Corp](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@Bianco\_David\_GE\_Corp](https://community.zeek.org/u/Bianco_David_GE_Corp)\
**Post date:** [December 16, 2011, 4:42pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160/2 "2011-12-16T16:42:08Z")

</div>

In your broscript file, you need to qualify the variable name. For example:

redef Module::myvar = somevalue;

David

---

<div class="post-metadata">

**Author:** ![Seth\_Hall3](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Seth\_Hall3](https://community.zeek.org/u/Seth_Hall3)\
**Post date:** [December 16, 2011, 4:42pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160/3 "2011-12-16T16:42:15Z")

</div>

Could you give a complete example? That feature does work, I use it regularly and it's even used in the tests.

.Seth

---

<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:** [December 16, 2011, 4:43pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160/4 "2011-12-16T16:43:49Z")

</div>

> Optional Internal values can be set as arguments,
> 
> Ex. bro -Cr somefile.trace some/policy/here myvar=somevalue
> 
> as well as at the script level,
> 
> Ex. redef myvar = somevalue;
> 
> Correct?

For variables declared with the &redef attribute, yes.

> It seems I cannot get the script level value to set, but the command line argument is correctly set.

It should work both ways. Is there a specific error you're getting or a specific/contrived example you can give?

+Jon

---

<div class="post-metadata">

**Author:** ![James\_Swaro](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@James\_Swaro](https://community.zeek.org/u/James_Swaro)\
**Post date:** [December 16, 2011, 8:41pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160/5 "2011-12-16T20:41:34Z")

</div>

Sorry about the late reply. The error is actually ‘pebcac’ in nature. The scripts that I had been editing weren’t placed back into the default policy path, which is why no matter the change , the same result occurred. Perhaps something that could be attributed to a lack of coffee in the early morning. Sorry guys 🙂

All is still well in the world of bro scripts.

---

<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:40pm UTC](https://community.zeek.org/t/optional-internal-values-bro-2-0/2160/6 "2022-05-06T15:40:04Z")

</div>


