Best Way to Grab Unique Domains and IPs for Rotation Interval

Hello all:

I would like to have a rotated pair of files that simply logs unique IPs and domains seen for a given interval (in my case 30 minutes). In evaluating ways to do this - I noted the known_hosts.bro script to be a great reference point, so I cooked something up that I thought would do this for me.

My script is as follows (it is heavily based on the known_hosts script).: