Parsing filters allows you to modify log file entries before they will be processed and saved into the database:
Parsing filters can be used to accomplish the following tasks:
To add new parsing filter use button. Parsing filter editor will appear:
Each parsing filter contains conditions and actions. Conditions are tested against log file line and determine whether filter's actions will be executed.
Parsing filters will be applied to each log file line starting from top to bottom one by one. However if a filter matches a log line and "Continue with other filters" option is turned off then further filters will not be tested.
The following fields can be used as a condition target:
Parsing filter actions
When all filter conditions are satisfied, the actions are performed. Action is used to change parameters of log file line. You can change resource name, query string, referrer and other parameters. Also you can set resource type and logging strategy for this request. Read more about resource types and logging strategies in the File types - Documentation
Log2Stats don't store query strings along with resource names to make parsing and reporting faster. If you have dynamic pages which generates different content according to supplied query string parameters, then you should use parsing filters to add these parameters to query string manually. I.e. if your pages looks like http://www.yoursite.com/content.php?page=Home then you want to add the following parsing filter:
Conditions: Resource matches ^/content.php Actions: Add the following variables from query string to resource name page
To add several variables specify all of them delimited with ','. It is also possible to add the whole query string to resource name. Use '*' in the variable field to do this.
Parsing filters allows you to assign two additional parameters to visit: advertizing campaign and advertizing parameter. Later you can use instant filters to filter statistics by these two parameters.
Advertizing campaign is a traffic source. I.e. you can exchange links with a 3rd party web site and use referring page as a condition to mark visitors who came from that web site. Or you can send e-mails to your subscribers and put a special link to your web site to track visits from e-mails. In this case you want to use resource name and/or query string as a condition.
Advertizing parameter is an additional parameter you can set for each advertizing. It can be a variable in the query string or referring page query string. Also it can be a static value.
Additional visitor information
Parsing filters allows you to retrieve additional user information like cookie based visitor ID,
screen resolution and colors, java script version and so on. To use this feature you will need to
insert a small java script into your pages and use "Get additional information from query string" action.
Parsing filter samples
The following filter will set resource type to undefined for all "Not found" resources and set logging strategy to "Non-visit" for them:
Conditions: Status equals 404 Resource name not equals /favicon.ico Actions: Set resource type to Other Set logging strategy to Non-visit
Filter below will add phpBB's forum id and thread id to resource name so you will be able to track your forum usage:
Conditions: Resource name matches ^/forum/(viewforum|viewtopic)\.php Actions: Add the following variables from query string to resource name f,t Set resource type to Page Set logging strategy to Visit
Next parsing filter allows you to track your e-mail advertizings. Assuming your e-mails links to your web site using the following ulrs: http://www.example.com/somepage.php?from=email&id=8
Conditions: Query string matches (^|&)from=email Actions: Advertizing campaign E-mail Take advertizing campaign parameter from the following query string variable id