This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HTTP Proxy log

I am wondering if there is any possibility to get time information out of my log files. (what time a user accessed a url). And what is the meaning of the first characters in every line. (xxxxxxxxxx.xxx). 
Hoping that someone can help me.    


This thread was automatically locked due to age.
Parents
  • Mawa,
      here is the perl script to help you to convert the timestamp used on http logs to date and time.

    --> script.pl
    #!/usr/bin/perl

    open (INP,"/var/chroot-squid/logs/access.log");
    while (not eof(INP)) {
        ($logtime,$otherinfo)=split(/ /,,2);
        ($sec,$min,$hour,$day,$mon,$year,$tmp,$tmp,$tmp) =localtime($logtime);
        $mon+=1; $year+=1900;
        print"$year/$mon/$day $hour:$min:$sec $otherinfo";
    }
     access.new.log

    It will generate a new logfile with the conventional time and date.

    I am running this script and it is working.  
Reply
  • Mawa,
      here is the perl script to help you to convert the timestamp used on http logs to date and time.

    --> script.pl
    #!/usr/bin/perl

    open (INP,"/var/chroot-squid/logs/access.log");
    while (not eof(INP)) {
        ($logtime,$otherinfo)=split(/ /,,2);
        ($sec,$min,$hour,$day,$mon,$year,$tmp,$tmp,$tmp) =localtime($logtime);
        $mon+=1; $year+=1900;
        print"$year/$mon/$day $hour:$min:$sec $otherinfo";
    }
     access.new.log

    It will generate a new logfile with the conventional time and date.

    I am running this script and it is working.  
Children
No Data