Loading ...
Sorry, an error occurred while loading the content.
 

GroupUrls are mutually exclusive?

Expand Messages
  • Josef Meile
    Hi, I have a website, which is on several languages and has several projects. I want to count not only the access to the different languages, but also to the
    Message 1 of 3 , Jul 6, 2004
      Hi,

      I have a website, which is on several languages and has several
      projects. I want to count not only the access to the different
      languages, but also to the projects.

      Here is how I do that:

      GroupURL /vrai_german/projekte/planprojekte/viwa VIWA
      GroupURL /vrai_italiano/projekte/planprojekte/viwa VIWA
      GroupURL /vrai_english/projekte/planprojekte/viwa VIWA
      GroupURL /vrai_german/* ICVR-Deutsch
      GroupURL /vrai_italiano/* ICVR-Italiano
      GroupURL /vrai_english/* ICVR-English

      I got this results for July 2004:
      1 2516 70.63% 54194 69.07% ICVR-Deutsch
      2 336 9.43% 5659 7.21% ICVR-English
      3 251 7.05% 6697 8.54% ICVR-Italiano
      4 96 2.70% 7344 9.36% VIWA

      However if I remove the two first groups, I got:
      1 2588 72.66% 59642 76.02% ICVR-Deutsch
      2 336 9.43% 5659 7.21% ICVR-English
      3 275 7.72% 8594 10.95% ICVR-Italiano

      If you see, there is a difference on the ICVR-Deutsch and
      ICVR-Italiano rows. They are suddenly bigger. Doing a more detailed
      analysis, I found that on the first case, the urls are grouped only
      once ie:

      the url: /vrai_german/projekte/planprojekte/viwa/index.html will be
      matched with the group: /vrai_german/projekte/planprojekte/viwa/, but
      not with the group: /vrai_german

      I did a last test: I put the VIWA groups at the end:

      GroupURL /vrai_german/* ICVR-Deutsch
      GroupURL /vrai_italiano/* ICVR-Italiano
      GroupURL /vrai_english/* ICVR-English
      GroupURL /vrai_german/projekte/planprojekte/viwa VIWA
      GroupURL /vrai_italiano/projekte/planprojekte/viwa VIWA
      GroupURL /vrai_english/projekte/planprojekte/viwa VIWA

      and got:
      1 2588 72.66% 59642 76.02% ICVR-Deutsch
      2 336 9.43% 5659 7.21% ICVR-English
      3 275 7.72% 8594 10.95% ICVR-Italiano

      The VIWA group isn't there anymore, which means that if an URL is
      matched with one group, it won't be matched with other groups anymore.
      Is this a feature or a bug? How can I solved it?

      Thanks in advanced,
      Josef
    • Josef Meile
      Answering to my own question: I found that the group matching is done by the function isinglist of the file webalizer.c . This function searches the url on
      Message 2 of 3 , Jul 6, 2004
        Answering to my own question: I found that the group matching is done
        by the function "isinglist" of the file "webalizer.c". This function
        searches the url on the group_urls list and return only the first
        occurence. It would be nice to implement another function which
        returns a list of matches, so an URL could belong to several groups,
        then one could proccess each list element.

        Regards,
        Josef

        --- In webalizer@yahoogroups.com, "Josef Meile" <jmeile@h...> wrote:
        > Hi,
        >
        > I have a website, which is on several languages and has several
        > projects. I want to count not only the access to the different
        > languages, but also to the projects.
        >
        > Here is how I do that:
        >
        > GroupURL /vrai_german/projekte/planprojekte/viwa VIWA
        > GroupURL /vrai_italiano/projekte/planprojekte/viwa VIWA
        > GroupURL /vrai_english/projekte/planprojekte/viwa VIWA
        > GroupURL /vrai_german/* ICVR-Deutsch
        > GroupURL /vrai_italiano/* ICVR-Italiano
        > GroupURL /vrai_english/* ICVR-English
        >
        > I got this results for July 2004:
        > 1 2516 70.63% 54194 69.07% ICVR-Deutsch
        > 2 336 9.43% 5659 7.21% ICVR-English
        > 3 251 7.05% 6697 8.54% ICVR-Italiano
        > 4 96 2.70% 7344 9.36% VIWA
        >
        > However if I remove the two first groups, I got:
        > 1 2588 72.66% 59642 76.02% ICVR-Deutsch
        > 2 336 9.43% 5659 7.21% ICVR-English
        > 3 275 7.72% 8594 10.95% ICVR-Italiano
        >
        > If you see, there is a difference on the ICVR-Deutsch and
        > ICVR-Italiano rows. They are suddenly bigger. Doing a more detailed
        > analysis, I found that on the first case, the urls are grouped only
        > once ie:
        >
        > the url: /vrai_german/projekte/planprojekte/viwa/index.html will be
        > matched with the group: /vrai_german/projekte/planprojekte/viwa/, but
        > not with the group: /vrai_german
        >
        > I did a last test: I put the VIWA groups at the end:
        >
        > GroupURL /vrai_german/* ICVR-Deutsch
        > GroupURL /vrai_italiano/* ICVR-Italiano
        > GroupURL /vrai_english/* ICVR-English
        > GroupURL /vrai_german/projekte/planprojekte/viwa VIWA
        > GroupURL /vrai_italiano/projekte/planprojekte/viwa VIWA
        > GroupURL /vrai_english/projekte/planprojekte/viwa VIWA
        >
        > and got:
        > 1 2588 72.66% 59642 76.02% ICVR-Deutsch
        > 2 336 9.43% 5659 7.21% ICVR-English
        > 3 275 7.72% 8594 10.95% ICVR-Italiano
        >
        > The VIWA group isn't there anymore, which means that if an URL is
        > matched with one group, it won't be matched with other groups anymore.
        > Is this a feature or a bug? How can I solved it?
        >
        > Thanks in advanced,
        > Josef
      • Josef Meile
        Finally I decided to make my own patch. I posted it here for the interested people (See the bottom of the message). I m aware that it could slow down the
        Message 3 of 3 , Jul 6, 2004
          Finally I decided to make my own patch. I posted it here for the
          interested people (See the bottom of the message).

          I'm aware that it could slow down the excecution of webalizer if one
          has a lot of grouped URLs, but I can wait a little bit. Keep in mind
          that I haven't tested it very much and it's just a quick solution to
          my problem. I think also that it could be applied to other Groups (ie:
          GroupSite). You only have to do some small modifications.

          If I were familiar with the code, I would perhaps add a swich to the
          config file, let's say GroupURLScan, which could be either "no", then
          it would only match the first occurence and exit or "yes", then it
          will scan all the groups. By default I would say "no".

          Regards,
          Josef

          --->Begin patch file
          diff -bur webalizer-2.01-10/linklist.c
          webalizer-2.01-10-patched/linklist.c
          --- webalizer-2.01-10/linklist.c Fri Jun 15 10:34:24 2001
          +++ webalizer-2.01-10-patched/linklist.c Tue Jul 6 21:40:26 2004
          @@ -271,6 +271,26 @@
          }

          /*********************************************/
          +/* ISINGLIST - Test if string is in list */
          +/* and returns all matches */
          +/* Patched version of Josef Meile */
          +/*********************************************/
          +NLISTPTR isinglist2(GLISTPTR list, char *str)
          +{
          + GLISTPTR lptr;
          + NLISTPTR lptr2=NULL;
          +
          + lptr=list;
          + while (lptr!=NULL)
          + {
          + if (isinstr(str,lptr->string)) add_nlist(lptr->name,&lptr2);
          + lptr=lptr->next;
          + }
          + return lptr2;
          +}
          +
          +
          +/*********************************************/
          /* ISINSTR - Scan for string in string */
          /*********************************************/

          diff -bur webalizer-2.01-10/linklist.h
          webalizer-2.01-10-patched/linklist.h
          --- webalizer-2.01-10/linklist.h Fri Sep 29 05:50:30 2000
          +++ webalizer-2.01-10-patched/linklist.h Tue Jul 6 21:27:10 2004
          @@ -42,6 +42,7 @@

          extern char *isinlist(NLISTPTR, char *); /* scan list for
          str */
          extern char *isinglist(GLISTPTR, char *); /* scan glist for
          str */
          +extern NLISTPTR isinglist2(GLISTPTR, char *); /* patched from
          Josef Meile */
          extern int add_nlist(char *, NLISTPTR *); /* add list item
          */
          extern int add_glist(char *, GLISTPTR *); /* add group list
          item */
          --->End patch file
        Your message has been successfully submitted and would be delivered to recipients shortly.