# Using for loop w/ &expire\_func

**URL:** <https://community.zeek.org/t/using-for-loop-w-expire-func/3086>\
**Category:** Zeek\
**Created:** [April 26, 2014, 4:28pm UTC](https://community.zeek.org/t/using-for-loop-w-expire-func/3086 "2014-04-26T16:28:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Liburdi](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Josh\_Liburdi](https://community.zeek.org/u/Josh_Liburdi)\
**Post date:** [April 26, 2014, 4:28pm UTC](https://community.zeek.org/t/using-for-loop-w-expire-func/3086/1 "2014-04-26T16:28:21Z")

</div>

I’m having a problem iterating over a table in an &expire\_func function. I receive this error: “value used but not set (t)”

When using this function with my table…

&expire\_func=function(t: table[string] of set[string,string,addr], idx: string): interval  
{  
for ( [x,y,z] in t[idx] )  
{  
print x;  
}  
return 0secs;  
};

Iterating over the table works with events, but I’d like to process indexes as they are removed from the table. Has anyone run into this before or know what might be causing the error?

---

<div class="post-metadata">

**Author:** ![Liburdi\_Josh\_GE\_Corp](https://avatars.discourse-cdn.com/v4/letter/l/d9b06d/32.png) [@Liburdi\_Josh\_GE\_Corp](https://community.zeek.org/u/Liburdi_Josh_GE_Corp)\
**Post date:** [April 28, 2014, 1:40pm UTC](https://community.zeek.org/t/using-for-loop-w-expire-func/3086/2 "2014-04-28T13:40:11Z")

</div>

Nevermind— I mistakenly had my table in the export section of the script. Moving it fixed my problem.

- Josh

---

<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/using-for-loop-w-expire-func/3086/3 "2022-05-06T15:41:44Z")

</div>


