Quantcast
Channel: 容器云计算,Devops,DBA,网络安全。
Viewing all articles
Browse latest Browse all 780

Elasticsearch:借助GeoIP数据库来实现显示请求来源的地理位置

$
0
0
 Elasticsearch:借助GeoIP数据库来实现显示请求来源的地理位置


借助GeoIP数据库来实现显示请求来源的地理位置,GeoIP 库可以根据 IP 地址提供对应的地域信息,包括国别,省市,经纬度等。

获取GeoIP数据库

wget https://raw.githubusercontent.com/wp-statistics/GeoLite2-City/master/GeoLite2-City.mmdb.gz

wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz  gzip -d GeoLite2-City.mmdb.gz

配置:

filter{

 
    geoip{
    
        source=>"client_ip"
    
        fields=>[ 
           "city_name",
           "country_name",
           "continent_code",
           "continent_name" 
            ]
         database=>"/etc/logstash/GeoLite2-City.mmdb" 
}

 参数:
  • source:设置解析IP地址的字段

  • fields:geoip数据库重需要的字段,主要有:city_name, continent_code, country_code2, country_code3, country_name, dma_code, ip, latitude, longitude, postal_code, region_name,timezone。

  • target:将geoip数据保存到一个字段内

  • database:IP地址数据库



Viewing all articles
Browse latest Browse all 780

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes