LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to add date n time in proxy access.log (https://www.linuxquestions.org/questions/linux-networking-3/how-to-add-date-n-time-in-proxy-access-log-579173/)

sunlinux 08-23-2007 05:05 AM

how to add date n time in proxy access.log
 
hi all,

how to add date n time in proxy access.log, can we log devices mac address also ?

unSpawn 08-23-2007 05:41 AM

how to add date n time in proxy access.log
What Proxy? What version? What's the logformat used now? If the first item of the log is a large number like "1187547180" it's date and time in epoch notation. As in
Code:

epoch2date() { EPOCH="$1"; /bin/date '+%Y-%m-%d %H:%M:%S %Z' \
--date "Jan 1, 1970 01:00:00 + $EPOCH seconds"; }


can we log devices mac address also
I am sure you can not. What purpose should it serve?

sunlinux 08-23-2007 06:31 AM

"epoch2date() { EPOCH="$1"; /bin/date '+%Y-%m-%d %H:%M:%S %Z' \
--date "Jan 1, 1970 01:00:00 + $EPOCH seconds"; }"

where to add above format in which file ?

can we log mac address of user machine accessing proxy ?

unSpawn 08-23-2007 06:54 AM

This problem solving thing kinda relies on people here asking the right questions and you giving the right answers. If you don't read replies well and don't answer questions then it's not gonna work. (The what proxy / version / logformat questions should make you realise you should be complete in providing information. More efficient.) Since you didn't I'll assert you're using Squid. If you use < 2.6 you can choose two logformats: native and CLF. If you use 2.6>= you check squid.conf and Squid docs for the "logformat" directive. (BTW the code was just an example to turn epoch into human readable notation, not something you will use configuring Squid.)


All times are GMT -5. The time now is 09:34 AM.