#9 Unable to detect date format from nginx log files

已关闭
matorban7 年前创建 · 1 条评论
matorban 评论于 7 年前

HOST - - [29/Sep/2015:19:52:02 +0200] “GET http://blabla HTTP/1.1” 200 4551 “-” “sfFeedReader/0.9”

This kind of format (nginx servor log) seems to not support by ttail. I get some huge anonymize log for test..

HOST - - [29/Sep/2015:19:52:02 +0200] "GET http://blabla HTTP/1.1" 200 4551 "-" "sfFeedReader/0.9" This kind of format (nginx servor log) seems to not support by ttail. I get some huge anonymize log for test..
yannweb 在代码提交 7 年前 中引用了该工单
yannweb7 年前 关闭
yannweb 评论于 7 年前
所有者

Thank’s for the comment.

In fact ttail was not able to autodetect nginx date format. But the programm should work using those options :

ttail -Er “^[^[]+[” -f “%d/%B/%Y:%H:%M:%S” -d “#-1h” /path/to/logs/access.log

There was 2 reason for autodetection not working problem :

  • the format “%d/%B/%Y:%H:%M:%S” is not in the list of format that ttail will try when autodetecting formats
  • there is a prefix before the date

I added the “%d/%B/%Y:%H:%M:%S” to the list of formats (in src/include/ttail.h ), but you will still have to give the -E -r prefix arguments !

Thank's for the comment. In fact ttail was not able to autodetect nginx date format. But the programm should work using those options : <pre> ttail -Er "^[^\[]+\[" -f "%d/%B/%Y:%H:%M:%S" -d "#-1h" /path/to/logs/access.log </pre> There was 2 reason for autodetection not working problem : - the format "%d/%B/%Y:%H:%M:%S" is not in the list of format that ttail will try when autodetecting formats - there is a prefix before the date I added the "%d/%B/%Y:%H:%M:%S" to the list of formats (in src/include/ttail.h ), but you will still have to give the -E -r prefix arguments !
登陆 并参与到对话中。
未选择里程碑
未指派成员
2 名参与者
到期时间

未设置到期时间。

依赖工单

此工单当前没有任何依赖。

正在加载...
取消
保存
这个人很懒,什么都没留下。