首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过cli更改AWSTATS配置

如何通过cli更改AWSTATS配置
EN

Server Fault用户
提问于 2015-11-20 17:52:30
回答 1查看 297关注 0票数 0

我的Apache日志文件包含在名称中的日期,我不能更改这个日期。是否有方法使用Windows提示符更改AWSTATS的LogFile配置参数?还是批处理脚本更好?当然,我可以尝试找到并替换我需要的东西,但是我不确定是否有一个简单的CLI命令内置到AWSTATS中,类似于这样:

awstats.pl -config LogFile="C:\path\to\log\file“

我打算编写一个批处理脚本,它将更改该选项,然后在一天结束的处理过程中更新AWSTATS db。

EN

回答 1

Server Fault用户

回答已采纳

发布于 2015-12-11 14:15:32

因此,我意识到AWSTATS提供了标记,您可以使用这些标记动态表示日期,这意味着您不必每天手动更改日期(无论是使用自定义代码还是实际上每天更改LogFile路径)。

代码语言:javascript
复制
# "LogFile" contains the web, ftp or mail server log file to analyze.
# Possible values: A full path, or a relative path from awstats.pl directory.
# Example: "/var/log/apache/access.log"
# Example: "../logs/mycombinedlog.log"
# You can also use tags in this filename if you need a dynamic file name
# depending on date or time (Replacement is made by AWStats at the beginning
# of its execution). This is available tags :
#   %YYYY-n  is replaced with 4 digits year we were n hours ago
#   %YY-n    is replaced with 2 digits year we were n hours ago
#   %MM-n    is replaced with 2 digits month we were n hours ago
#   %MO-n    is replaced with 3 letters month we were n hours ago
#   %DD-n    is replaced with day we were n hours ago
#   %HH-n    is replaced with hour we were n hours ago
#   %NS-n    is replaced with number of seconds at 00:00 since 1970
#   %WM-n    is replaced with the week number in month (1-5)
#   %Wm-n    is replaced with the week number in month (0-4)
#   %WY-n    is replaced with the week number in year (01-52)
#   %Wy-n    is replaced with the week number in year (00-51)
#   %DW-n    is replaced with the day number in week (1-7, 1=sunday)
#                              use n=24 if you need (1-7, 1=monday)
#   %Dw-n    is replaced with the day number in week (0-6, 0=sunday)
#                              use n=24 if you need (0-6, 0=monday)
#   Use 0 for n if you need current year, month, day, hour...
# Example: "/var/log/access_log.%YYYY-0%MM-0%DD-0.log"
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log"
# You can also use a pipe if log file come from a pipe :
# Example: "gzip -cd /var/log/apache/access.log.gz |"
# If there are several log files from load balancing servers :
# Example: "/pathtotools/logresolvemerge.pl *.log |"
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/737868

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档