手机版
你好,游客 登录 注册
背景:
阅读新闻

Hadoop分析Tomcat访问日志

[日期:2012-01-27] 来源:Linux社区  作者:dsbjoe [字体:大 中 小]

日志样例:

Tomcat日志代码
  1. 172.16.2.12,-,-,[06/Sep/2011:10:03:13 +0800],GET /icestat/jpivot/toolbar/sort-asc-up.png HTTP/1.1,200,336,-,Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)   
  2. 172.16.2.12,-,-,[06/Sep/2011:09:48:17 +0800],GET /icestat/ HTTP/1.1,200,171,http://10.65.11.241:8080/icestat/,Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.43 Safari/534.24  

 

把日志放入hdfs

命令行代码
  1. Hadoop fs -put icestat_access_log.2011-09-06.txt icestat_access_log.2011-09-06.txt  

 分析日志

命令行代码
  1. hadoop jar tomcatLog.jar icestat_access_log.2011-09-06.txt output6  

 查看输出

命令行代码
  1. [root@www.linuxidc.com hadoop-0.20.2]# hadoop fs -cat output6/part-r-00000  
  2. 11/09/06 00:18:54 WARN conf.Configuration: DEPRECATED: hadoop-site.xml found in the classpath. Usage of hadoop-site.xml is deprecated. Instead use core-site.xml, mapred-site.xml and hdfs-site.xml to override properties of core-default.xml, mapred-default.xml and hdfs-default.xml respectively   
  3. 11/09/06 00:18:54 WARN fs.FileSystem: "xxx :9000" is a deprecated filesystem name. Use "hdfs://xxx :9000/" instead.   
  4. 11/09/06 00:18:54 WARN fs.FileSystem: "xxx :9000" is a deprecated filesystem name. Use "hdfs://xxx :9000/" instead.   
  5. 11/09/06 00:18:54 WARN fs.FileSystem: "xxx :9000" is a deprecated filesystem name. Use "hdfs://xxx :9000/" instead.   
  6. chrome  58  
  7. firefox 23  
  8. other   49  
  9. safari  5  
linux
相关资讯       Tomcat  Hadoop 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款