Finding IP in connection list and reverse DNS

Hi folks!

I try to develop a script that is started every 5 seconds to look up connected IPs from a specific interal IP in the firewall/connection list.

e.g. 192.168.88.5 has some active tcp established sessions to 8.8.8.8

then the script should use this command:

tool fetch url=("https://api.hackertarget.com/reversedns/\?q=8.8.8.8") output=user as-value

and saves the returned data to a file!

Unfortunately I didn’t figured it out. Can someone help me?