tomcat access日志:
{
"@version" => "1",
"@timestamp" => "2016-10-22T12:58:07.000Z",
"path" => "/data01/applog_backup/zjzc_log/zj-api-access01.2016-10-22",
"host" => "dr-mysql01.zjcap.com",
"type" => "zj_api_access",
"clientip" => "10.252.142.174",
"time" => "22/Oct/2016:20:58:07 +0800",
"verb" => "GET",
"api" => "/api/validate/code/send",
"httpversion" => "1.1",
"http_status_code" => "200",
"bytes" => "52",
"remoteip" => "115.51.148.47",
"response_time" => 0.015,
"messager" => "zj_api_access- 10.252.142.174 - - [22/Oct/2016:20:58:07 +0800] \"GET /api/validate/code/send?mobilePhone=15090308333&messageType=1&_=1454297673274 HTTP/1.1\" 200 52 0.015 115.51.148.47"
} "message" , "\s*%{IPORHOST:clientip}\s+\-\s+\-\s+\[%{HTTPDATE:time}\]\s+\"%{WORD:verb}\s+(?<api>(\S+))\?.*\s+HTTP/%{NUMBER:httpversion}\"\s+%{NUMBER:http_status_code}\s+%{NUMBER:bytes}\s+(%{BASE16FLOAT:request_time})\s+%{IPORHOST:remoteip}",
"message" ,"\s*%{IPORHOST:clientip}\s+\-\s+\-\s+\[%{HTTPDATE:time}\]\s+\"%{WORD:verb}\s+(?<api>(\S+))\s+HTTP/%{NUMBER:httpversion}\"\s+%{NUMBER:http_status_code}\s+%{NUMBER:bytes}\s+(%{BASE16FLOAT:request_time})\s+%{IPORHOST:remoteip}",
"message" ,"\s*%{IPORHOST:clientip}\s+\-\s+\-\s+\[%{HTTPDATE:time}\]\s+\"%{WORD:verb}\s+(?<api>(\S+))\s+HTTP/%{NUMBER:httpversion}\"\s+%{NUMBER:http_status_code}\s+\-\s+(%{BASE16FLOAT:request_time})\s+%{IPORHOST:remoteip}",
"message","\s*%{IPORHOST:clientip}\s+\-\s+\-\s+\[%{HTTPDATE:time}\]\s+\"%{WORD:verb}\s+(?<api>(\S+))\s+HTTP/%{NUMBER:httpversion}\"\s+%{NUMBER:http_status_code}\s+\-\s+(%{BASE16FLOAT:request_time})\s+(%{IPORHOST:remoteip}|-)" tomcat catalina日志; {
"@timestamp" => "2016-10-22T12:59:22.877Z",
"@version" => "1",
"path" => "/data01/applog_backup/zjzc_log/zj-api02-catalina.out.2016-10-22",
"host" => "dr-mysql01.zjcap.com",
"type" => "zj_api",
"messager" => "zj_api- 2016-10-22 20:59:22,877 INFO com.zjzc.interceptor.ClientAuthInterceptor - authInfo servletPath=/validate/code/send,clientSn=null,access=true",
"time" => "2016-10-22 20:59:22,877",
"Level" => "INFO"
} filter {
grok {
match => [ "message","\s*%{TIMESTAMP_ISO8601:time}\s+(?<Level>(\S+)).*"]
}
date {
match => ["time", "yyyy-MM-dd HH:mm:ss,SSS"]
}
mutate {
remove_field =>["message"]
}
} nginx access 日志; {
"message" => " 10.171.246.184 [22/Oct/2016:21:00:40 +0800] \"GET /resources/images/icon/icon_phone_gray.273e583f.png HTTP/1.1\" - 200 352 \"https://www.zjcap.cn/resources/css/base.css?06212016\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36\" 0.000 115.236.160.82",
"@version" => "1",
"@timestamp" => "2016-10-22T13:00:40.000Z",
"path" => "/data01/applog_backup/zjzc_log/zj-frontend01-access.2016-10-22",
"host" => "dr-mysql01.zjcap.com",
"type" => "zj_frontend_access",
"clientip" => "10.171.246.184",
"time" => "22/Oct/2016:21:00:40 +0800",
"verb" => "GET",
"request" => "/resources/images/icon/icon_phone_gray.273e583f.png",
"httpversion" => "1.1",
"http_status_code" => "200",
"bytes" => "352",
"http_referer" => "https://www.zjcap.cn/resources/css/base.css?06212016",
"http_user_agent" => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36",
"http_x_forwarded_for" => "115.236.160.82",
"geoip" => {
"ip" => "115.236.160.82",
"country_code2" => "CN",
"country_code3" => "CHN",
"country_name" => "China",
"continent_code" => "AS",
"region_name" => "02",
"city_name" => "Hangzhou",
"latitude" => 30.293599999999998,
"longitude" => 120.16140000000001,
"timezone" => "Asia/Shanghai",
"real_region_name" => "Zhejiang",
"location" => [
[0] 120.16140000000001,
[1] 30.293599999999998
],
"coordinates" => [
[0] 120.16140000000001,
[1] 30.293599999999998
]
},
"response_time" => 0.0,
"messager" => "zj_frontend_access 10.171.246.184 [22/Oct/2016:21:00:40 +0800] \"GET /resources/images/icon/icon_phone_gray.273e583f.png HTTP/1.1\" - 200 352 \"https://www.zjcap.cn/resources/css/base.css?06212016\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36\" 0.000 115.236.160.82" filter {
grok {
match =>[
"message","%{IPORHOST:clientip} \[%{HTTPDATE:time}\] \"%{WORD:verb} %{URIPATHPARAM:request}\?.* HTTP/%{NUMBER:httpversion}\" \- %{NUMBER:http_status_code} %{NUMBER:bytes} \"(?<http_referer>\S+)\" \"(?<http_user_agent>(\S+\s+)*\S+)\" (%{BASE16FLOAT:request_time}) (%{IPORHOST:http_x_forwarded_for}|-)",
"message" , "%{IPORHOST:clientip} \[%{HTTPDATE:time}\] \"%{WORD:verb} %{URIPATHPARAM:request} HTTP/%{NUMBER:httpversion}\" \- %{NUMBER:http_status_code} %{NUMBER:bytes} \"(?<http_referer>\S+)\" \"(?<http_user_agent>(\S+\s+)*\S+)\" (%{BASE16FLOAT:request_time}) (%{IPORHOST:http_x_forwarded_for}|-)",
"message","%{IPORHOST:clientip} \[%{HTTPDATE:time}\] \"%{WORD:verb} (?<http_url>\S+)\s+HTTP/%{NUMBER:httpversion}\"\s+\-\s+%{NUMBER:http_status_code}\s+%{NUMBER:bytes}\s+\"\-\"\s+\"(?<http_user_agent>(\S+))\"\s+(%{BASE16FLOAT:request_time})\s+(%{IPORHOST:http_x_forwarded_for}|-)",
"message","%{IPORHOST:clientip} \[%{HTTPDATE:time}\] \"%{WORD:verb} %{URIPATHPARAM:request} HTTP/%{NUMBER:httpversion}\" \- %{NUMBER:http_status_code} %{NUMBER:bytes} \"\" \"(?<http_user_agent>(\S+\s+)*\S+)\" (%{BASE16FLOAT:request_time}) (%{IPORHOST:http_x_forwarded_for}|-)" ]
} nginx error 日志; "message" => " 2016/10/22 21:00:32 [error] 12890#0: *98081 open() \"/var/www/zjzc-web-frontEnd/favicon.ico\" failed (2: No such file or directory), client: 10.171.246.184, server: localhost, request: \"GET /favicon.ico HTTP/1.1\", host: \"www.zjcap.cn\"",
"@version" => "1",
"@timestamp" => "2016-10-22T13:00:32.000Z",
"path" => "/data01/applog_backup/zjzc_log/zj-frontend01-error.2016-10-22",
"host" => "dr-mysql01.zjcap.com",
"type" => "zj_frontend_error",
"time" => "2016/10/22 21:00:32",
"severity" => "error",
"pid" => "12890",
"errormessage" => "*98081 open() \"/var/www/zjzc-web-frontEnd/favicon.ico\" failed (2: No such file or directory)",
"remote_addr" => "10.171.246.184",
"server" => "localhost",
"request" => "\"GET /favicon.ico HTTP/1.1\"",
"request_host" => "\"www.zjcap.cn\""
} filter {
grok {
match => [ "message" , "(?<time>%{YEAR}[./-]%{MONTHNUM}[./-]%{MONTHDAY}[- ]%{TIME}) \[%{LOGLEVEL:severity}\] %{POSINT:pid}#%{NUMBER}: %{GREEDYDATA:errormessage}(?:, client: (?<remote_addr>%{IP}|%{HOSTNAME}))(?:, server: %{IPORHOST:server}?)(?:, request: %{QS:request})?(?:, upstream: (?<upstream>\"%{URI}\"|%{QS}))?(?:, host: %{QS:request_host})?(?:, referrer: \"%{URI:referrer}\")?"]
}
date {
match => ["time", "yyyy/MM/dd HH:mm:ss"]
}
}

最新文章

  1. spring spring data jpa save操作事务
  2. 学习笔记 DataGridView数据导出为Excel
  3. Mybatis 学习-1
  4. poj 1753 Flip Game
  5. android 运行 python
  6. mysql merge
  7. CodeForce---Educational Codeforces Round 3 Load Balancing 正题
  8. STL学习系列六:List容器
  9. AndroidStudio旧模板使用方法
  10. Interview Algorithm
  11. Chapter 01:创建和销毁对象
  12. vue2.0动态绑定图片src属性值初始化时报错
  13. PBRT笔记(8)——材质
  14. weblogic/tomcat Get乱码【转】
  15. UVa 10377 - Maze Traversal
  16. 计算Pan手势到指定点的角度
  17. HDU 1007 Quoit Design(经典最近点对问题)
  18. 在ubuntu上部署Kubernetes管理docker集群示例, vxlan,gre
  19. google GFS
  20. HDU 2121——Ice_cream’s world II——————【最小树形图、不定根】

热门文章

  1. [转] What is the point of redux when using react?
  2. iOS 数据持久化(1):属性列表与对象归档
  3. 【转载】ASP.NET支持多语言
  4. 学习微信小程序之css15解决父盒子高度塌陷
  5. svn设置
  6. offie2010设置前两页和后面显示不同页码的方法
  7. mysqldump备份、还原数据库路径名含有空格的处理方法(如:Program Files)
  8. Html5实现头像上传和编辑,保存为Base64的图片过程
  9. java_设计模式_外观模式_Facade Pattern(2016-08-09)
  10. html 中 #include file 的用法