AWStatsでMailログ解析
インストール
- AWStats完全日本語版をDLする。
AWStats Ver6.5 完全日本語版のページ
http://www.bflets.dyndns.org/Tools/AWStatsJpn.html
(不適切であればリンクを削除いたします)
インストール関連も上記ページを参照するとさくさくっと終わります。
- 以下オリジナルと完全日本語版の相違点(引用)
・単語の置き換えレベルだったユーザーインターフェースを、日本語として"自然"に見えるように修正。
・メンテナンスされていないと思われるメッセージファイルをちゃんと更新。
・英語のままだったTooltip Helpを日本語化。
・以下に示す日本の検索エンジンが検出されるように修正。
Google(J), Biglobe, Nifty, MSN(J), ODN, Excite(J), Naver, Fresheye, TOCC, Infoseek, AskJeeves(J)など
・日本ローカルブラウザであるSleipnirとLunascapeを検出するように修正。
・日本ローカルロボット(はてなアンテナ, Bookmark Renewal Agentなど)を検出するように修正。
・日本語の検索語が正常に検出されない(文字化け)を修正。
・Google/Yahooのキャッシュ経由でのアクセスを正常に検出されるように修正。
・付属ドキュメントの日本語化(予定)。
- Jcode.pmをDLし、インストールする。
解凍後、以下のコマンドでインストール #perl Makefile.PL; make; make install
設定
- メールログ解析
/etc/awstats/awstats.xxxx.conf をコピーして awstats.mail.conf を作成。
通常の Postfix, Sendmail, Qmail などであれば以下のように設定LogFile=”perl /path/to/maillogconvert.pl standard < /pathtomaillog/maillog |"
Qmailのログで vadmin (バーチャルホストのメールサーバ) を利用している場合の設定LogFile=”perl /path/to/maillogconvert.pl vadmin < /pathtomaillog/maillog |"
以下共通の設定です。LogType=M LogFormat=”%time2 %email %email_r %host %host_r %method %url %code %bytesd” LevelForBrowsersDetection=0 LevelForOSDetection=0 LevelForRefererAnalyze=0 LevelForRobotsDetection=0 LevelForWormsDetection=0 LevelForSearchEnginesDetection=0 LevelForFileTypesDetection=0 ShowMenu=1 ShowMonthStats=HB ShowDaysOfMonthStats=HB ShowDaysOfWeekStats=HB ShowHoursStats=HB ShowDomainsStats=0 ShowHostsStats=HBL ShowAuthenticatedUsers=0 ShowRobotsStats=0 ShowEMailSenders=HBL ShowEMailReceivers=HBL ShowSessionsStats=0 ShowPagesStats=0 ShowFileTypesStats=0 ShowFileSizesStats=0 ShowBrowsersStats=0 ShowOSStats=0 ShowOriginStats=0 ShowKeyphrasesStats=0 ShowKeywordsStats=0 ShowMiscStats=0 ShowHTTPErrorsStats=0 ShowSMTPErrorsStats=1
解析実行
- ログを静的に解析(公開向け)
AWStatsの実行フォルダに移動。./awstats.pl -config=mail -updateまずは解析を実行して…perl ./awstats.pl -config=mail -output -staticlinks > awstats.htmlこれだけだとリンク部分が作成されないので…perl ./awstats.pl -config=mail -output=allhosts -staticlinks > awstats.mail.allhosts.html perl ./awstats.pl -config=mail -output=lasthosts -staticlinks > awstats.mail.lasthosts.html perl ./awstats.pl -config=mail -output=unknownip -staticlinks > awstats.mail.unknownip.html perl ./awstats.pl -config=mail -output=allemails -staticlinks > awstats.mail.allemails.html perl ./awstats.pl -config=mail -output=lastemails -staticlinks > awstats.mail.lastemails.html perl ./awstats.pl -config=mail -output=allemailr -staticlinks > awstats.mail.allemailr.html perl ./awstats.pl -config=mail -output=lastemailr -staticlinks > awstats.mail.lastemailr.html
こんなかんじでスクリプトを組むと幸せになれるかもしれない。
- ログを動的に解析(自分専用でにやにやする人向け)
わからんので調べてやってください。
アクセス制限かけないとあぶないです。
でもログにフィルタとかかけれるので玄人な人はこっちのがいいかもしれん。
FTPログ解析 (proFTPd)
proFTPdのログを解析する
- 先人がおられます
- コメントをどうぞ。
- コメントテスト中 -- (eromilkinfo) 2006-12-01 21:03:34