{"id":802,"date":"2011-05-15T13:15:22","date_gmt":"2011-05-15T11:15:22","guid":{"rendered":"http:\/\/hex.ro\/wp\/?p=802"},"modified":"2015-05-03T23:57:57","modified_gmt":"2015-05-03T21:57:57","slug":"awstats-logformat-and-nginx-log_format","status":"publish","type":"post","link":"https:\/\/hex.ro\/wp\/blog\/awstats-logformat-and-nginx-log_format\/","title":{"rendered":"AWStats LogFormat and nginx log_format"},"content":{"rendered":"<p>To parse nginx logs using AWStats &#8211; their log formats need to match.<\/p>\n<p>My setup is like this:<\/p>\n<ol>\n<li><span style=\"text-decoration: underline;\">nginx log_format<\/span> (specified in nginx.conf file):\n<pre class=\"lang: bash\">log_format      main  '$remote_addr - $remote_user [$time_local] $request \"$status\" $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\" \"$document_root\"'<\/pre>\n<\/li>\n<li>AWStats LogFormat (specified in your domain configuration file):\n<pre class=\"lang: bash\">LogFormat = \"%host %other %other %time1 %method %url %other %code %bytesd %refererquot %uaquot %otherquot %otherquot\"<\/pre>\n<\/li>\n<\/ol>\n<p>Hope it helps \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To parse nginx logs using AWStats &#8211; their log formats need to match. My setup is like this: nginx log_format (specified in nginx.conf file): log_format main &#8216;$remote_addr &#8211; $remote_user [$time_local] $request &#8220;$status&#8221; $body_bytes_sent &#8220;$http_referer&#8221; &#8220;$http_user_agent&#8221; &#8220;$http_x_forwarded_for&#8221; &#8220;$document_root&#8221;&#8216; AWStats LogFormat (specified in your domain configuration file): LogFormat = &#8220;%host %other %other %time1 %method %url %other %code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-802","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/posts\/802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/comments?post=802"}],"version-history":[{"count":7,"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/posts\/802\/revisions"}],"predecessor-version":[{"id":1645,"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/posts\/802\/revisions\/1645"}],"wp:attachment":[{"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/media?parent=802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/categories?post=802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hex.ro\/wp\/wp-json\/wp\/v2\/tags?post=802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}