Class: Dap::Filter::FilterGeoIPAsn
- Inherits:
-
Object
- Object
- Dap::Filter::FilterGeoIPAsn
- Includes:
- BaseDecoder, GeoIPLibrary
- Defined in:
- lib/dap/filter/geoip.rb
Overview
Add GeoIP ASN tags using the MaxMind GeoIP::ASN database
Constant Summary
Constants included from GeoIPLibrary
GeoIPLibrary::GEOIP_ASN, GeoIPLibrary::GEOIP_CITY, GeoIPLibrary::GEOIP_DIRS, GeoIPLibrary::GEOIP_ORGS
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from BaseDecoder
Methods included from Base
Instance Method Details
#decode(ip) ⇒ Object
85 86 87 88 89 90 |
# File 'lib/dap/filter/geoip.rb', line 85 def decode(ip) return unless @@geo_asn geo_hash = @@geo_asn.look_up(ip) return unless (geo_hash and geo_hash[:name]) { :asn => geo_hash[:name].split(' ')[0] } end |