Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: ReetP on July 19, 2018, 05:17:16 PM

Title: grep headache
Post by: ReetP on July 19, 2018, 05:17:16 PM
Doing my head in with this with AWStats

I have some strings in a log.

/index.php?main_page=product_info&products_id=3301

/index.php?main_page=product_info&cPath=33&products_id=3188

The string can vary a little but the defining match is:

product_id=some.number

I tried this and a load of variations that all failed :-(

^\/.*\&products_id=(\d+)


Any suggestions on a grep pattern to match this?
Title: Re: grep headache
Post by: holck on July 19, 2018, 09:03:22 PM
Here is a suggestion:
Code: [Select]
egrep "^/.*\&products_id=[0123456789]+"

Doing my head in with this with AWStats

I have some strings in a log.

/index.php?main_page=product_info&products_id=3301

/index.php?main_page=product_info&cPath=33&products_id=3188

The string can vary a little but the defining match is:

product_id=some.number

I tried this and a load of variations that all failed :-(

^\/.*\&products_id=(\d+)


Any suggestions on a grep pattern to match this?
Title: Re: grep headache
Post by: ReetP on July 19, 2018, 09:27:59 PM
Ah cool thanks.

I'll give it a whirl and let you know !!