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}|-)"
}
}
geoip {
source => "http_x_forwarded_for"
add_tag => [ "geoip" ]
# database => "/var/geoip/GeoLiteCity.dat" 不是必须
}
}
{
"message" => " 10.168.255.134 [01/Sep/2016:17:40:09 +0800] \"GET /resources/js/index.js?v=20160629 HTTP/1.1\" - 200 8249 \"https://wenjinbao.winfae.com/\" \"Mozilla/5.0 (Windows NT
6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\" 0.001 115.234.131.214",
"@version" => "1",
"@timestamp" => "2016-09-01T09:41:45.430Z",
"path" => "/data01/applog_backup/winfae_log/wj-frontend02-access.2016-09-01",
"host" => "dr-mysql01.zjcap.com",
"type" => "wj_frontend_access",
"clientip" => "10.168.255.134",
"time" => "01/Sep/2016:17:40:09 +0800",
"verb" => "GET",
"request" => "/resources/js/index.js?v=20160629",
"httpversion" => "1.1",
"http_status_code" => "200",
"bytes" => "8249",
"http_referer" => "https://wenjinbao.winfae.com/",
"http_user_agent" => "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
"request_time" => "0.001",
"http_x_forwarded_for" => "115.234.131.214",
"geoip" => {
"ip" => "115.234.131.214",
"country_code2" => "CN",
"country_code3" => "CHN",
"country_name" => "China",
"continent_code" => "AS",
"region_name" => "02",
"city_name" => "Wenzhou",
"latitude" => 27.99940000000001,
"longitude" => 120.66680000000002,
"timezone" => "Asia/Shanghai",
"real_region_name" => "Zhejiang",
"location" => [
[0] 120.66680000000002,
[1] 27.99940000000001
]
},
"tags" => [
[0] "geoip"
]
获取nginx ip地理信息
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:安装GeoIP数据库
下一篇:数据接口示例
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
获取IP地址
端点(API接口)访问获取IP地址!
IP Java SpringBoot\ -
地理信息云服务
有大佬雄心勃勃,准备打造一个地理信息能在多集群甚至单集群中,不同机器提供的服务,存储的数据不一样,所以负载均衡算法要依据情况而定。缓存对于地图来说,就是切片。切片文件应
GIS集群 GIS缓存 地理信息平台 关系型数据库 nosql