Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page URLs hostnames are not set correctly when importing logs with cs-host field #7341

Closed
Brutonix opened this issue Mar 3, 2015 · 8 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@Brutonix
Copy link

Brutonix commented Mar 3, 2015

Scenario:
1 website installed on Windows 2008 r2 IIS 7.5. The website is configured with several bindings. eg. http://www.mysite1.com, http://www.mysite2.com, http://www.mysite3.com
image

The IIS logs are configured with the default settings and I have added cs-host to be recorded.
image

I have installed Piwik 2.11.1 on a linux server and configured a site with ID:16, Name:MySite, URLs:http://www.mysite1.com, http://www.mysite2.com, http://www.mysite3.com and left everything else as default.
image

I then run the import_logs.py that was supplied with the Piwik installation.
Within Piwik, the Vistor Log displays the default website address http://www.mysite1.com and not the correct URL that was hit.
image

The IIS logs report the correct URL / cs-host
image

If you amend some lines in import_logs.py, the correct information is displayed within Piwik.
From line 1468, make the following changes:

only prepend main url if it's a path

url = (main_url if path.startswith('/') else '') + path[:1024]

try:
url = 'http://' + hit.host + path
except AttributeError:
url = (main_url if path.startswith('/') else '') + path[:1024]

And now my Visitor Logs report the correct URL

@mattab
Copy link
Member

mattab commented Mar 3, 2015

Hi @Brutonix thanks for the report. Can you please paste here a short log file (maybe 10-20 lines) so we can try reproduce the issue?

@mattab mattab changed the title Multiple Bindings : 1 Site Page URLs hostnames are not set correctly when importing logs with cs-host field Mar 3, 2015
@Brutonix
Copy link
Author

Brutonix commented Mar 3, 2015

Mattab,
You've lost me on the request for a short log file, as I have given the repo steps in the above scenario with a solution.

@mattab
Copy link
Member

mattab commented Mar 3, 2015

Thanks for the instructions above, they are really great 👍 but to reproduce, since none of us use IIS, it would help to get the log file. Could you send it, even privately to hello@piwik.org ?

@Brutonix
Copy link
Author

Brutonix commented Mar 3, 2015

Ah, I see, will do when I'm at work tomorrow.

@mattab
Copy link
Member

mattab commented Apr 8, 2015

@Brutonix any update maybe about this short log file we could use to reproduce?

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Apr 8, 2015
@mattab mattab added this to the Short term milestone Apr 8, 2015
@mattab
Copy link
Member

mattab commented Apr 8, 2015

Maybe it's similar or duplicate of #7396

@Brutonix
Copy link
Author

Brutonix commented Apr 8, 2015

Matthieu,

An email was sent on the 4th March. Do you need me to send it again ?

Regards
On 8 Apr 2015 7:50 am, "Matthieu Aubry" notifications@github.com wrote:

Maybe it's similar or duplicate of #7396
#7396


Reply to this email directly or view it on GitHub
#7341 (comment).

@mattab
Copy link
Member

mattab commented Apr 13, 2015

Thanks @Brutonix - it would be great if you could send your log again to hello@piwik.org as I didn't get it the last time. Also I've created an issue for this bug in log-analytics project: matomo-org/matomo-log-analytics#67

@mattab mattab closed this as completed Apr 13, 2015
@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

2 participants