-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use empty result when location is nil #73
Conversation
end | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace?
end | ||
|
||
context "when IP is IPv6 format for localhost" do | ||
# regression test for issue https://github.com/logstash-plugins/logstash-filter-geoip/issues/51 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-paste
@tag_on_failure.each{|tag| event.tag(tag)} | ||
end | ||
|
||
def set_data(event, geo_data = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this method necessary?
maybe a better approach is to have a geo_data
object that is instantiated with Hash.new
and then gets populated by the above populate_data
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, i thought I can dry up usages like here: https://github.com/logstash-plugins/logstash-filter-geoip/pull/73/files#diff-0ceaeedc6497c6d61fa5ae1d2db1dc58R173
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also makes it easier when Java Event API work needs to be done :)
@talevy let me know if this is better |
@@ -174,7 +174,7 @@ | |||
end | |||
|
|||
it "should not have added any tags" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new behavior not in sync with test name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh crap, let me change
@talevy updated |
LGTM |
For some IPs location and most fields are nil. Its better to return empty geoip than Elasticsearch barfing with mapping errors.
Also added tests for IPv6 now that GeoIP2 supports it
Fixes #70