Re: [Bro-Dev] Check if table element exists

2017-08-08 Thread Reinhard Gentz
Thank you! Exactly what I was looking for On Tue, Aug 8, 2017 at 11:27 AM, Aashish Sharma wrote: > (Not sure if I am interpreting your question right but here is how I read > it) > > basically use "in" operator > > > local my_ip_table : table[addr] of bool ; > > local ip: addr

Re: [Bro-Dev] Check if table element exists

2017-08-08 Thread Aashish Sharma
(Not sure if I am interpreting your question right but here is how I read it) basically use "in" operator local my_ip_table : table[addr] of bool ; local ip: addr = 127.0.0.1 if ( ip in my_ip_table) found else not found btw, you can also use "!in" operator too which is

Re: [Bro-Dev] Check if table element exists

2017-08-08 Thread Azoff, Justin S
You're looking for 'in' http://try.bro.org/#/?example=basics-composite-types-table -- - Justin Azoff > On Aug 8, 2017, at 2:04 PM, Reinhard Gentz wrote: > > Hi, > > I would like to check if a certain table element exists and then take > corresponding action like the

Re: [Bro-Dev] Check if table element exists

2017-08-08 Thread Johanna Amann
Use "in": if ("my_dynamic_name" in mytable) Johanna On 8 Aug 2017, at 11:04, Reinhard Gentz wrote: > Hi, > > I would like to check if a certain table element exists and then take > corresponding action like the following: > > if (exists(mytable["my_dynamic_name"])) > do something > else >

[Bro-Dev] Check if table element exists

2017-08-08 Thread Reinhard Gentz
Hi, I would like to check if a certain table element exists and then take corresponding action like the following: if (exists(mytable["my_dynamic_name"])) do something else do something else Can someone give me a hint? Reinhard ___ bro-dev