Announcement

Collapse
No announcement yet.

daily email of search log?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    daily email of search log?

    Before I reinvent the wheel, has anyone implemented a daily/weekly email of the previous 24 hours or 7 days of the search log from their server that they'd be prepared to share?
    I find the log useful for pointers and priorities on adding new products, but the occasional FTP download as and when I remember is a pain.
    It should be a fairly trivial shell script running under cron but my Unix shell scripting is rusty to say the least.

    Cheers,
    simon
    Cult Pens

    #2
    Can other forum users post here please and let Simon know if he needs to reinvent the wheel or not. Has anyone been able to implement this request?

    Kind regards,
    Bruce King
    SellerDeck

    Comment


      #3
      I run Sawmill log analyser. It provides overall search words/phrases and search phrases by search engine as two of the available reports. Date period can be filtered to individual day, week, month, year, whatever.

      It can be set to automatically download the logs by ftp.
      Bill
      www.egyptianwonders.co.uk
      Text directoryWorldwide Actinic(TM) shops
      BC Ness Solutions Support services, custom software
      Registered Microsoft™ Partner (ISV)
      VoIP UK: 0131 208 0605
      Located: Alexandria, EGYPT

      Comment


        #4
        Thanks Bill, but that's presumably the web server log you're referring to. I'm just interested in the Actinic search.log file.
        Thinking about it I don't need to do any fancy grep stuff, just a daily email of the existing search.log; concatenate it to search.log.archive and then delete it. Seems the simplest way, and time I started getting into shell scripts again I suppose. Heigh ho. A project for after Christmas I think.

        Cheers,
        simon
        Cult Pens

        Comment


          #5
          It is for server logs, where is the existing search.log file? I've never heard of it.

          I can get the search terms from Sawmill by showing the parameters used on the perl script call.
          Bill
          www.egyptianwonders.co.uk
          Text directoryWorldwide Actinic(TM) shops
          BC Ness Solutions Support services, custom software
          Registered Microsoft™ Partner (ISV)
          VoIP UK: 0131 208 0605
          Located: Alexandria, EGYPT

          Comment


            #6
            Bill - there is a mod in the AUG which allows the creation of a log file for what is entered into the sites simple search and advanced search boxes - I think it is this which Simon is referring to


            Bikster
            SellerDeck Designs and Responsive Themes

            Comment


              #7
              @Simon

              If you are creating a log from the simple and advanced search boxes on your site you are best off not calling it search.log .... your competitors could access the file and see what people are searching for! You have the option to name the log file - best to make it very obscure eg TggYre43H.log


              Bikster
              SellerDeck Designs and Responsive Themes

              Comment


                #8
                I use the search.log file, but i just look at it online, and delete it from time to time.

                It is useful for seeing what people are looking for which isn't stocked, I also use it to ensure that people can find item I do have but they may search on a different term.

                It holds better info for interrogation that awstats etc.

                Simon if you do manage to find something please post

                Comment


                  #9
                  Originally posted by wjcampbe
                  It is for server logs, where is the existing search.log file? I've never heard of it.
                  See http://community.actinic.com/showthread.php?t=1366
                  Simply logs what people enter into an Actinic search box. It's amazing/enlightening what people type into it...

                  Cheers,
                  simon
                  Cult Pens

                  Comment


                    #10
                    Simon - just as a thought what about using a synchronisation tool with the server set as a mapped drive?


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      Hello all,

                      I've dabbled in writing perl scripts and when I saw this thread I thought I'd have a go at solving the problem.

                      Now I've not managed to come up with an automated log emailer but the below CGI script will open your search log file, copy the data into an email and send it to you, and then delete the log file so a new one is created by the next search.

                      With the use of recurring tasks in Outlook, you can create a link to the script and with just one click you'll be emailed. I had wondered about using IE to do the job of running the script as a scheduled task, but I could find a way of making it open to a page that isn't your home page.

                      As I said before, I've only dabbled in perl script so if any one has any comments, suggestions, criticisms, I'll be glad to here them. Obviously, the usual warnings about backing up data, etc apply. Remember, this script will DELETE your search log (which will be remade when a new search is performed), so if you don't want it to be deleted, remove or comment out the following line:

                      unlink($logfile);

                      To use this script, copy the code below into notepad and make the relevant changes as detailed in the first few lines — remember to leave the backslash before the @ sign in the email addresses. Save the file as log_email.cgi (or whatever you like .cgi) and upload it to your actalog folder. Then CHMOD the file to 755. Now simply use a browser to visit http://www.yourdomain.com/acatalog/log_email.cgi and you're done.

                      I have noticed however that the email occassionally takes a little while to arrive but I'm not sure what's causing that.

                      Enjoy

                      David

                      Code:
                      #!/usr/bin/perl
                      
                      # Enter your email address below 
                      # *IMPORTANT* LEAVE THE BACKSLASH BEFORE THE AT (@) SIGN
                      $emailaddress = "name\@yourdomain.com";
                      
                      # Enter your CC email address below - can be left blank 
                      # *IMPORTANT* LEAVE THE BACKSLASH BEFORE THE AT (@) SIGN
                      $CCemailaddress = "cc_name\@yourdomain.com";
                      
                      # Enter you search log file name below
                      $logfile = "search.log";
                      
                      open(FILE, $logfile) || die "Unable to open file: $!";
                      @data = <FILE>;
                      close (FILE);
                      
                      open (MAIL, "|/usr/sbin/sendmail -t") || return 0;
                      
                      select (MAIL);
                      print << "EOF";
                      To:   $emailaddress
                      Cc:   $CCemailaddress
                      From: Actinic Search Log 
                      Subject: Actinic Search Log
                      
                      @data
                      
                      EOF
                      close(MAIL);
                      select (STDOUT);
                      printThankYou();
                      
                      
                      sub printThankYou(){ 
                      print << "EOF";
                      Content-Type: text/html
                      
                      <HTML>
                      <HEAD>
                      <TITLE>Actinic Search Log</TITLE>
                      </HEAD>
                      <BODY>
                      <TABLE CELLSPACING=2 CELLPADDING=2 border=0 width=600>
                       <TR>
                        <TD>
                          <CENTER>
                          <BR>
                          <FONT SIZE=+3><B>Thank You</b></font>
                          <BR><BR><BR>
                          <B><FONT SIZE=+1>Your Actinic search log has been emailed to you.</FONT></B>
                          </CENTER>
                         </TD>
                       </TR>
                      </TABLE>
                      </BODY>
                      </HTML>
                      
                      EOF
                      } 
                      
                      unlink($logfile);
                      David
                      Mandrake Press Ltd

                      <a href="http://www.mandrake-press.co.uk" target="_blank">www.mandrake-press.co.uk</a>

                      Comment


                        #12
                        Originally posted by jont
                        @Simon

                        If you are creating a log from the simple and advanced search boxes on your site you are best off not calling it search.log .... your competitors could access the file and see what people are searching for! You have the option to name the log file - best to make it very obscure eg TggYre43H.log
                        Interesting point, but attempting to retrieve http://www.cultpens.com/acatalog/search.log results in an Access Denied message.

                        Cheers,
                        simon
                        Cult Pens

                        Comment


                          #13
                          My hacking skills are not too sharp (paranoia is much keener) hence the concern for non standard file names ... but if the server is preventing access then brilliant


                          Bikster
                          SellerDeck Designs and Responsive Themes

                          Comment


                            #14
                            Originally posted by David@MPL
                            I've dabbled in writing perl scripts and when I saw this thread I thought I'd have a go at solving the problem.
                            Thanks for having a go - as I'm away for a few weeks from Monday I'll have to have a look when I get back. Just one thought: if you could append the contents of the search file to search.log.archive (or whatever) before deleting it then there's a safe backup of it's contents over time that's useful for other types of analysis.
                            I don't know Perl, so I don't if there's an easy way to do that.

                            Cheers,
                            simon
                            Cult Pens

                            Comment


                              #15
                              Possible, but I'd still prefer to see only the entries since I last saw it, plus ideally it needs the entries with my (fixed) IP address filtering out.

                              Cheers,
                              simon
                              Cult Pens

                              Comment

                              Working...
                              X