: Grep directory name Need a script to grep within a directory for folders named by emails (so looking for the @) to then search the apache logs to see if the email address grep'ed has accessed
Need a script to grep within a directory for folders named by emails (so looking for the @ ) to then search the apache logs to see if the email address grep'ed has accessed the website today.
Then after this I need to look at the user-agents detail to see what browser they are using
More posts by @Frith620
1 Comments
Sorted by latest first Latest Oldest Best
for i in `ls emaildir/*@*`
do
grep $i logfile | grep '['`date +%d/%b/%Y` | awk -F" '{print }'
done
Where emaildir is the directory of files containing email addresses and logfile is the apache logfile.
What it's doing is this:
getting each file in the email directory with an @ in the filename
searching the log file for lines containing that filename
then searching those lines for today's date in the format used by logfiles
then splitting the line at quote marks and printing the sixth part, which is the browser string
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.