Comments (7)
http://dev.maxmind.com/geoip/geoip2/geolite2/
我在这里下载的免费版测试下来就可以. (不过我们公司是买的付费的 :)
你用的哪个版本? 完全的配置和报错发我一下吧.
from hangout.
使用 maxmind 的 City 库就正常,但是使用 Country 库就失败。
hangout 版本:hangout-0.1.8.2-ES2.3.5
相关配置如下:
- GeoIP2:
source: client_ip # required
target: geoip # default geoip
database: '/xxx/GeoLite2-Country.mmdb'
Debug 日志如下:
2016-11-30 16:14:01,510 DEBUG com.ctrip.ops.sysdev.filters.GeoIP2 pool-2-thread-1 java.lang.UnsupportedOperationException: Invalid attempt to open a GeoLite2-Country database using the city method
{request=xxx, source_host=xxx, method=GET, resp_len=21483, version=1.1, source_ip=223.xxx.xxx.xxx, tags=[geoipfail], resp_time=46974, @timestamp=2016-11-30T16:02:38.000+08:00, client_ip=183.xxx.xxx.xxx, fields={"severity":"3","pri-text":"local7.err","severity-text":"err","processid":"-","pri":"187","facility-text":"local7","program":"xxxxxx","facility":"23"}, status=200}
from hangout.
@childe 你好,我想询问一下关于这个 issue 现在的状况
from hangout.
@keefeleen 抱歉没注意到.
是我之前不知道对于country级别的数据库, 还有专门的country级别的API. 修复后的我已经上传到master上面了. 但当前是支持5.0ES的版本了. 你可能需要自己把master分支的filter/Geoip2.java代码考到你需要的版本下, 然后自己打包了.
如果你不知道怎么弄, 或者有什么问题, 联系我, 我打包好发你吧.
from hangout.
@childe 编译之后,country 级别数据库目前没有问题,但是用我们公司自己编译的数据库就有问题。
附件中是一个编译好用于测试的数据库(其中的 IP 列表比较少)。但是测试时 logstash 无报错(只不过因为数据问题解析出来字段 location 字段为空),如果使用 hangout 则仍然出现 geofail 的错误。
麻烦再看一下这个问题。谢谢!
from hangout.
@keefeleen logstash应该是一个第三方的插件吧,里面用到的读取mmdb库的ruby代码也是mmdb外的第三方作者写的, 根据IP定位到数据之后, 返回一个hash, 没有问题.
我这里用的是mmdb官方提供的库, https://github.com/maxmind/GeoIP2-java 调用的CountryResponse country(InetAddress ipAddress)和CityResponse city(InetAddress ipAddress) 这两个方法, 他们会先判断mmdb数据库中的metadata里面的database_type(具体说明参见https://maxmind.github.io/MaxMind-DB/, 你们应该也是按这个文档来制作的吧?)是不是包含 Country 或者 City. 看起来你们制作的库不包含, 所以报错了. 就把这个字符串改一下好了. 比如叫 "keefeleen Country db"
from hangout.
注释掉了 GeoIP2-java 中对应进行判断的代码,重新编译后目前看来没有问题。感觉这一个判断流程比较鸡肋。
感谢你的热心回复!
from hangout.
Related Issues (20)
- hangout 清洗日志到clickhouse CPU过高问题 HOT 9
- 重复消费问题 HOT 4
- newkafka 怎么在output elasticsearch 用kafka 做index HOT 4
- Newkafka: java.util.ArrayList cannot be cast to java.util.Map HOT 3
- elasticsearch6 6.3.0 使用search guard HOT 2
- 一个json的里面还有几层json,有现成的filter吗 HOT 1
- 怎么把日志的时间替换成es中的@timestamp HOT 6
- hangout hanging HOT 7
- hangout启动后没有任何报错,写入不到clickhouse中 HOT 3
- kafka中消息为序列化后的字节数据,Input反序列化后,filter是否支持消息的过滤和提取 HOT 7
- zk域名解析后的ip更改后hangout无法切换 HOT 4
- 是否支持output if elasticsearch HOT 4
- watcher访问失败,目测是 jackson-annotations-2.8.2.jar版本不符合undewrtow的要求
- 有没有过滤日志的功能,类似于logstash的drop功能 HOT 1
- 建议添加split 拆分事件filter HOT 3
- 请问有没有类似logstash的metadata的功能 HOT 5
- 求指导一下,想提取 [ ] 里面的内容, 这种数据怎么用grok分割,参考了logstash的写法,没效果 HOT 3
- Dependency conflicts on org.jruby.jcodings:jcodings, leading to inconsistent program behaviors HOT 2
- 日期时间能不能格式化两次
- hangout实例占用内存问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hangout.