# using &\*\_expire with interval values defined before

**URL:** <https://community.zeek.org/t/using-expire-with-interval-values-defined-before/687>\
**Category:** Zeek\
**Created:** [February 8, 2005, 3:00am UTC](https://community.zeek.org/t/using-expire-with-interval-values-defined-before/687 "2005-02-08T03:00:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vern](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/vern/32/630_2.png) [@Vern](https://community.zeek.org/u/Vern)\
**Post date:** [February 8, 2005, 3:00am UTC](https://community.zeek.org/t/using-expire-with-interval-values-defined-before/687/1 "2005-02-08T03:00:35Z")

</div>

> policy-script:  
> \> const tcp\_scan\_period = 2 min &redef;  
> \> global tcp\_scan: table[addr] of count &write\_expire=tcp\_scan\_period;
> 
> error:  
> \> line xx (tcp\_scan\_period): bad tag in ExprVal::Val

Here's a patch to fix the bug. (Also, a work-around would be to instead  
stick "2 min" directly in rather than using a variable.) This will be  
included in the upcoming release.

&nbsp;&nbsp;&nbsp;&nbsp;Vern

--- Val.cc.ORIG 2005/02/07 23:46:08 1.1  
+++ Val.cc 2005/02/08 00:49:59  
@@ -1490,7 +1490,7 @@

&nbsp;&nbsp;&nbsp;if ( a )  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
- expire\_time = a-\>AttrExpr()-\>ExprVal()-\>AsInterval();  
+ expire\_time = a-\>AttrExpr()-\>Eval(0)-\>AsInterval();

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// As network\_time is not necessarily initialized yet,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// we set a timer which fires immediately.

---

<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:37pm UTC](https://community.zeek.org/t/using-expire-with-interval-values-defined-before/687/2 "2022-05-06T15:37:21Z")

</div>


