Skip to content
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

Merged
merged 5 commits into from
Apr 29, 2016

Conversation

suyograo
Copy link
Contributor

@suyograo suyograo commented Apr 28, 2016

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

end

Copy link
Contributor

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
Copy link
Contributor Author

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 = {})
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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 :)

@suyograo
Copy link
Contributor Author

@talevy let me know if this is better

@@ -174,7 +174,7 @@
end

it "should not have added any tags" do
Copy link
Contributor

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?

Copy link
Contributor Author

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

@suyograo
Copy link
Contributor Author

@talevy updated

@talevy
Copy link
Contributor

talevy commented Apr 29, 2016

LGTM

@suyograo suyograo merged commit fe06deb into logstash-plugins:master Apr 29, 2016
@suyograo suyograo deleted the fix/70 branch April 29, 2016 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants