Forum Discussion

Mike_Rausch_628's avatar
Mike_Rausch_628
Icon for Nimbostratus rankNimbostratus
Feb 09, 2009

IRULE to track connections

I have created an IRULE to track connections to links we have posted for training videos.

 

 

A message is sent to a log file for every different video we have posted and then all of the connections are counted and tallied using a script.

 

 

Unfortunately, there is a search engine hitting the links quite a bit and I would like to put a line in the rule to discard that connection.

 

 

any help would be appreciated.

 

 

Thanks

3 Replies

  • Is there any way that you could sanatize the iRule you wrote and post it as well?
  • It looks like this...

     

     

    when HTTP_REQUEST

     

    set fdstr [fdstr [HTTP::uri] "/" 1]

     

    if { $fdstr equals "videos/video1.html"}{

     

    log local0. "User [IP::client_addr] has connected to video - video1"

     

    }

     

    if { $fdstr equals "videos/video2.html"}{

     

    log local0. "User [IP::client_addr] has connected to video - video2"

     

    }

     

    if { $fdstr equals "videos/video3.html"}{

     

    log local0. "User [IP::client_addr] has connected to video - video3"

     

    }

     

    }

     

     

  • If you know the IP of the webbot, you can simply add a line like this:

    if { [IP::remote_addr] equals "a.b.c.d"} { 
     reject 
     log lcoal0. "search engine rejected : [IP::remote_addr]" 
     return 
     }