Script to get the browser version for user
===

I've written a script to get the browser version of users but I need to clean up the output. What the script does is looks at the apache logs for @ and IE8 then emails me the information. The problem I have is the output as when the grep finds a email address and IE8  it gives me the full output - i.e. /page/code/user@foobar.com/home.php whereas the output i'm looking is the just the email address and to only have this information recorded once a day:

Example:

user@foobar IE8

Thanks

    #!/bin/bash
    
    #Setting date and time (x and y and z aren't being used at the moment)
    x="$(date +'%d/%b/%Y')"
    y="$(date +'%T')"
    z="$(date +'%T' | awk 'BEGIN { FS =":"} ; {print $1}')"
    
    #Human readable for email title
    emaildate=$(date +"%d%b%Y--Hour--%H")
    
    #Setting date and time for grep and filename
    beta="$(date +'%d/%b/%Y:%H')"
    sigma="$(date +'%d-%b-%Y-%H')"
    
    #CurrentAccess logs
    log='/var/logs/access.log'
    
    #Set saved log location
    newlogs=/home/user/Scripts/browser/logs
    
    #Prefrom the grep for the current day
    grep @ $log | grep $beta | awk 'BEGIN { FS = " " } ; { print $7 }' | sort -u >> $newlogs/broswerusage"$sigma".txt 
    mail -s "IE8 usage for $emaildate" user@exmaple.com < $newlogs/broswernusage"$sigma".txt

