I reconstructed Piwik's log_import.py, to import the format of apache fluentd. And I later revealed to solve problems when we use Piwik under the Japanese (multibyte character set). More further information, please see the link https://osdn.jp/projects/piwik-fluentd/wiki/FrontPage
Thank you for attention.
5. なぜ Piwik なのか
■ Urchin がなくなった
□ google に買収され、現在は google Analytics になった
□ アプリケーションであり google にデータを渡すことなく自前でログ
解析ができた
■ ID を分けて、担当の Web サイト以外の集計は見せないようし
たい
■ google にアクセスログ渡したくない
■ Open Source でログが取り込めるのは Piwik だけ
□ もちろん他もあるけどどれも開発はだいぶ前に終了、今からみれば
低機能
5 of 28
26. Piwik トラッカーからの文字列が文字化け
■ piwik/core/Tracker/PageUrl.php
public static function cleanupString($string)
{
$string = trim($string);
- $string = str_replace(array("n", "r", "0"), ’’, $string);
-
+ if (function_exists(’mb_check_encoding’)
+ && !@mb_check_encoding($string, ’utf-8’, true)
+ ) {
□ mb check encoding の三番目のパラメータが重要
□ It would perform a more thorough check, and the result of that call
would be FALSE.2
2
http://stackoverflow.com/questions/17958226/what-does-mbstring-strict-
detection-do26 of 28