Forum Moderators: phranque

Message Too Old, No Replies

410 Gone

Can an IP be captured and written to file?

         

cookie2

8:36 pm on Jan 26, 2015 (gmt 0)

10+ Year Member



When someone tries to access a page that's been set as 410 Gone, is there a way that the IP of the person requesting it can be captured and written to a text file?

phranque

8:47 pm on Jan 26, 2015 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



that information should already be in the web server access log.

cookie2

8:54 pm on Jan 26, 2015 (gmt 0)

10+ Year Member



Understand that. But I'm trying to see if there's a way to isolate those IP's to a text file so I don't have to comb through thousands of access log entries each day.

penders

9:41 pm on Jan 26, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you using a custom error document? Or just allowing a default server response? If the former then you could obviously write something in your language of choice to do this, but presumably you are after an automated server approach?

[edited by: penders at 10:31 pm (utc) on Jan 26, 2015]

lucy24

10:23 pm on Jan 26, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



so I don't have to comb through thousands of access log entries each day.

You don't have to comb by hand, for heaven's sake :) Just do a global search for

^[\d.]+ {blahblah here} HTTP/1\.[01]" 410

and capture the first part. As an alternative, you can attach a script to your 410 page to record the information in a separate file.

And I hope you do have a custom 410 page, for the sake of humans. The server default 410 tends to be even scarier than the default 404.