# Bro policy script: vector

**URL:** <https://community.zeek.org/t/bro-policy-script-vector/1818>\
**Category:** Development\
**Tags:** development\
**Created:** [February 17, 2011, 7:56pm UTC](https://community.zeek.org/t/bro-policy-script-vector/1818 "2011-02-17T19:56:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregor\_Maier](https://avatars.discourse-cdn.com/v4/letter/g/94ad74/32.png) [@Gregor\_Maier](https://community.zeek.org/u/Gregor_Maier)\
**Post date:** [February 17, 2011, 7:56pm UTC](https://community.zeek.org/t/bro-policy-script-vector/1818/1 "2011-02-17T19:56:58Z")

</div>

Hi,

I was wondering how I can use vectors in Bro policy script.

\* How can I add/delete elements?  
\* Where can I add/delete elements (at the beginning? at the end? both)  
&nbsp;&nbsp;(i.e., can it be used as stack and/or FIFO)  
\* How can I iterate over the vector?  
\* Can I insert elements at arbitrary positions? Delete at arbitrary  
&nbsp;&nbsp;positions?

(there don't seem be too many places in the default scripts were vectors  
are used and it seems that most are used as consts).

I think I've also seen places where "table[count] of XYZ" is used  
instead of a vector.

cu  
Gregor

---

<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 18, 2011, 4:47am UTC](https://community.zeek.org/t/bro-policy-script-vector/1818/2 "2011-02-18T04:47:50Z")

</div>

Gregor and I already talked about this earlier, with the conclusion  
that there isn't much support for working with vectors right now.

---

<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:39pm UTC](https://community.zeek.org/t/bro-policy-script-vector/1818/3 "2022-05-06T15:39:27Z")

</div>


