www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

Exporting captive portal logs to Excel

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell
View previous topic :: View next topic  
Author Message
samirghaliz



Joined: 05 Aug 2011
Posts: 7

PostPosted: Fri Jan 06, 2012 6:26 pm    Post subject: Exporting captive portal logs to Excel Reply with quote

Hello all,

I would like to export captive portal logs in syslog to excel and was wondering if you have any suggestions on how to extract the information and save as a text file.

Thanks,
sam
Back to top
View user's profile Send private message
michael



Joined: 11 Jul 2013
Posts: 6

PostPosted: Thu Jul 11, 2013 8:04 pm    Post subject: Reply with quote

Try this as Cron job to list all accounts with the name "roomxx":
pakRad(){

echo "Cost;IP;Last;MAC;NAS;RX;TX;Time;Traffic;start;stop;room" >/tmp/log.csv
cd /Database/var/register/system/acct/entries/
for DIRNAME in `find ./r* -name MAC -printf "%h "`
do
echo ${DIRNAME} | sed -e"s/\.\/\(room..\)\/.*/\1/"
# awk 'FNR==1{f++}{a[f,FNR]=$1}END{for(x=1;x<=FNR;x++){for(y=1;y<ARGC;y++)printf("%s ",a[y,x]);print ""}}' ${DIRNAME}/* >>/tmp/log.csv
awk 'FNR==1{f++}{a[f,FNR]=$1}END{for(x=1;x<=FNR;x++){for(y=1;y<ARGC;y++)printf("%s;",a[y,x])}}' ${DIRNAME}/* >>/tmp/log.csv
echo ${DIRNAME} | sed -e"s/\.\/\(room..\)\/.*/\1/" >>/tmp/log.csv
done

ftp yourFtpServer.xx<<EOF
ftpUser
ftpPassword
put /tmp/log.csv ./log.csv
quit
EOF
rm -f /tmp/log.csv
}

pakRad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group