Closed subutux closed 10 years ago
can you merge this? I had already written one but this one looks fine too. thanks!
ok, there are a couple of changes that should be made;
this.save_latlon = this.save_latlon == 'false';
should be true
and it would be much more useful to save the coordinates in an array called lonlat (in that order) so Kibana's bettermap can display them.
data[this.use_attr + '_geo_lonlat'] = [geo['ll'][1],geo['ll'][0]];
I have made these modifications locally (renaming latlon to lonlat with the above difference) and it works great.
Can you add documentation and tests ?
At least docs ?
I'll try to write some documentation tonight. Never written tests for NodeJS in my life...
@subutux I have renamed config fields for geoip filter to be more compliant with other filter. I have added some tests.
Hi,
I've created a geoip filter for node-logstash. haven't tested it yet, but should work.
It uses the geoip-lite (
npm install geoip-lite
) library, from https://github.com/bluesmoon/node-geoip and is able to lookup an ip's location and could add the following data:*_geoip_lon: the lon
the asterisk'es are replaced with the attribute defined by `use_attr``(defaults to host).
Usage
filter://geoip://?use_attr=postfix_source&save_city=false&save_region=false&save_latlon=false&save_country=true