Been trying for a while to get this script fully working I think I'm nearly there.
Ok so I basically need the script to show 3 things, email address - Browser type - Time logged in.
EMAILS='/home/user/emaillist.txt' MAIL=$EMAILS while read MAIL; do grep -f $EMAILS /var/log/apache2/ssl_access.log>>/home/user/test.txt done < $EMAILS
I need some way of first using the todays date in here so it only searches the apache logs for that data. I was thinking about using the linux date +"[%d/%b/%Y" command in the script as this will match the correct date formate.
The other aspect is that I only need the output to show the user's email address | Browser type and date from apache nothing else.
Managed to play around with the script and got it to this stage where it works fine I just need to work out how to add browser data into the text file?
x=$(date +"%d/%b/%Y") y=$(date +"%d%b%Y") filename=emaillist.txt while read filename do if COUNT=$(grep $filename /var/log/apache2/ssl_access.log |grep -c $x) then echo $filename:$COUNT>>/home/user/logs/usage"$y".txt fi done < emaillist.txt