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

Fix setting direction and ignore_outgoing decision #557

Merged
merged 2 commits into from
Dec 18, 2015

Conversation

monicasarbu
Copy link
Contributor

@monicasarbu
Copy link
Contributor Author

I didn't test the current fix. We need to add tests with "direction" and "ignore_outgoing".

debug("Ignore duplicated transaction on %s: %s -> %s",
publisher.name, srcServer, dstServer)
return false
if publisher.IgnoreOutgoing && event["direction"] == "out" {
Copy link

Choose a reason for hiding this comment

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

move the check for IgnoreOutgoing into the else branch line 159. Then we don't have to query the value from hashmap and have it more localized (plus much cheaper execution).

Totally agree with logic of 'direction' and 'ignore_outgoing' implemented by this changeset.

@tsg
Copy link
Contributor

tsg commented Dec 18, 2015

Just a note with what we discussed in the team meeting: the current logic for direction "out" is wrong because it's not simply as an else for "in", without checking that the source IP address is actually local. It would make sense I think to fix that as part of this PR, but your call if you prefer to have another PR for that.

@monicasarbu
Copy link
Contributor Author

@tsg @urso I just noticed your comments, after I committed my version. I hope I answered your concerns.

@@ -133,6 +133,7 @@ func filterEvent(event common.MapStr) error {
func updateEventAddresses(publisher *PublisherType, event common.MapStr) bool {
var srcServer, dstServer string
src, ok := event["src"].(*common.Endpoint)
fmt.Println(ok)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please delete the Printlns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do. Thanks.

@tsg
Copy link
Contributor

tsg commented Dec 18, 2015

LGTM.

…ore defining the value of the direction. Adding tests.
@monicasarbu
Copy link
Contributor Author

Ready

@tsg tsg added the v1.1.0 label Dec 18, 2015
tsg added a commit that referenced this pull request Dec 18, 2015
Use direction to check if it's an outgoing leg
@tsg tsg merged commit 95414f7 into elastic:master Dec 18, 2015
@monicasarbu monicasarbu changed the title Use direction to check if it's an outgoing leg Fix setting direction and ignore_outgoing Dec 21, 2015
@monicasarbu monicasarbu changed the title Fix setting direction and ignore_outgoing Fix setting direction and ignore_outgoing decision Dec 21, 2015
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.

3 participants