Search and Replace filter issues

24 views
Skip to first unread message

Oceane F.

unread,
Dec 2, 2009, 10:12:46 AM12/2/09
to Urchin Software from Google - help forum - Urchin 6
Hi everybody,

I need your help once again! I tried to solve the problem on myself,
but I obviously failed...

I want to use a search and replace filter in order to modify the
user_agent field.
I have created the filter, selected "cs_useragent" for the Filter
Field, and provided the search and replace Strings as I wanted.
Afterwards I added this filter to the associated profile, deleted the
previous data linked to this profile and tried to run it. That didn't
work.
I tried to add the log source to the filter, to change the string I
wanted to replace (by a copy-paste method), but that still doesn't
work. I am already using an Exclude Pattern filter (for an other
profile but the same log file) successfully.
So did I miss something?

I am currently using Urchin 6.5.01 with a Demo licence.

Thanks in advance,
Oceane

Kirk - Actual Metrics

unread,
Dec 2, 2009, 3:32:32 PM12/2/09
to Urchin Software from Google - help forum - Urchin 6
Hi Oceane,

First off, it's a better practice to add filters/log sources to
profiles. Adding filters to log sources just gets messy. Can you post
the search and replace strings you're trying to use and some more
detail of what you're trying to accomplish?

Kirk
www.urchintools.com
www.urchinexperts.com
www.actualmetrics.com

Oceane F.

unread,
Dec 3, 2009, 4:56:05 AM12/3/09
to Urchin Software from Google - help forum - Urchin 6
Hi Kirk,

I have remove filters from log source s and log sources from filters
but that still doesn't work.
I have also tried to change my Search & Replace filter to an Exclude
Pattern filter and that worked.

What I am trying to do is to modify the user-agent field: for some
reasons, there can be several closing brackets at the end of it:
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)))"
I would like to remove them in order to have only one bracket. I could
do that during the log creation but it would be better for me if it's
done in the Urchin side.
For the search string I use: \).*\"
and for the replace one: \)\"

I don't think that the problem is the search or replace string I use
(even if they might be wrong), because I tried to change them and that
still doesn't work.
For example I tried: "Windows NT 5.1" as a search string and
"Mac_PowerPC" as a replace string.
I even changed the Filter Field in order to change the pages' name for
example but that didn't work either.
I also tried to select "yes" or "no" for the "Case Sensitve" field and
to add or emove quotes for the Search or Replace fields.

Thank you,
Oceane


On Dec 2, 8:32 pm, Kirk - Actual Metrics <kirk.mora...@gmail.com>
wrote:

Jeremy Aube

unread,
Dec 4, 2009, 10:12:26 AM12/4/09
to Urchin Software from Google - help forum - Urchin 6
Hi Oceane,

Try the following filter:

Filter Name: Replace Parens
Filter Type: Advanced
Field A: cs_useragent (RAW)
Extract A: ([^)]*\))\)*$
Field B: (None)
Extract B:
Output To: cs_useragent (RAW)
Constructor: $A1
Field A Required: Yes
Field B Required: No
Override Output Field: Yes
Case Sensitive: No

Jeremy Aube
ROI Revolution

Oceane F.

unread,
Dec 4, 2009, 10:40:26 AM12/4/09
to Urchin Software from Google - help forum - Urchin 6
Hi Jeremy,

That doesn't seem to work either...
Do I need a special configuration to use the search&replace filters
because none of them seems to workanyway ?

Thanks,
Oceane

Oceane F.

unread,
Dec 14, 2009, 4:35:01 AM12/14/09
to Urchin Software from Google - help forum - Urchin 6
Hello everybody,

I am still trying to create and use a search and replace filter but it
still doesn't work.

For example if I create an exclude filter excluding the pattern url1
from the cs_request field it is working, but if I try to create a
replace filter the same pattern url1 by the pattern url2 for example
that won't work.
Where can be the problem?

Thanks for your help,
Oceane

Oceane F.

unread,
Dec 14, 2009, 6:10:08 AM12/14/09
to Urchin Software from Google - help forum - Urchin 6
After having working out a bit more on this issue I found out that the
filter works but not as I expected:

Let's take a page named page1. I would like that this page appears
under the name "newname" in the reports.
I created a search&replace filter to look in the cs_request field and
replace the string "page1" by "newname".
In my reports I was still seeing this page under the name "page1".
Then, I have noticed that if I applied an exclude filter to filter out
page1 after having applied the replace filter, page1 was still there,
nevertheless, when I use an exclude filter to filter out the string
"newname", it works.

So the filter is really working but not its effects are not visible in
the report side. Is that logical?
How can I do to see this effects in the reports (so see page1 under
the name "newname")?

Thanks,
Oceane

Jeremy Aube

unread,
Dec 15, 2009, 8:52:01 AM12/15/09
to Urchin Software from Google - help forum - Urchin 6
Hi Oceane,

I think the issue in that case in that the reports don't use the
cs_request field. Most of the reports dealing with pages use
request_stem (AUTO). Most reports use (AUTO) fields rather than (RAW)
fields, so it's best to try these out first if you're working on a
filter.

To avoid trial and error in finding the right filter field:

1. View lib/reporting/profiletypes/Default/defaults.rs2.
2. Find the row that contains your report and note the data table.
3. View lib/reporting/profiletypes/Default/datamap.dm2.
4. Find the data table from #2 and look at the numbers that correspond
to the fields used by this data table.
5. View lib/reporting/logformats/fieldlist.txt and find the fields
that correspond to the numbers from #4.

You should then have a list of fields that are used in your report,
which you can then run search and replace filters on.

Personally, I find that using Advanced works better than using Search
and Replace filters. Anything you can do with a Search and Replace
filter can be done with an Advanced filter, and often easier. Note
that the filter I gave earlier was an Advanced filter rather than a
Search and Replace.

Jeremy Aube
http://www.roirevolution.com/urchin
Reply all
Reply to author
Forward
0 new messages