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

Migrate plugins with server plugin helper #1382

Merged
merged 7 commits into from
Dec 21, 2016

Conversation

tagomoris
Copy link
Member

This change updates in_syslog and in_forward.

Updating in_syslog is to use server plugin helper to enable multi-worker processing.
I also added/updated some parameters to inject hostname/address of data source, for consistent parameter names with in_forward.

I also found that in_forward don't have a parameter to inject source host address (not hostname).
So I added it too.

… existing one

* source_hostname_key
* source_address_key

These are to show hostname/address clearly to users.
This update also marks "include_host_key" as deprecated.
@tagomoris tagomoris self-assigned this Dec 20, 2016
@tagomoris
Copy link
Member Author

@repeatedly Could you review this change?

@tagomoris tagomoris force-pushed the migrate-plugins-with-server-plugin-helper branch from c1626d2 to ddd7baa Compare December 20, 2016 10:14
@tagomoris
Copy link
Member Author

@repeatedly ping

Copy link
Member

@repeatedly repeatedly left a comment

Choose a reason for hiding this comment

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

Implementation looks good.

@@ -340,12 +350,31 @@ def check_and_skip_invalid_event(tag, es, remote_host)
new_es
end

def add_source_host(es, host)
def add_source_host(es, conn)
Copy link
Member

Choose a reason for hiding this comment

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

add_source_info or something is better.

Copy link
Member Author

Choose a reason for hiding this comment

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

right.

PEERADDR = ['?', '0000', '127.0.0.1', '127.0.0.1']
LOCALHOST_HOSTNAME_GETTER = ->(){sock = UDPSocket.new(::Socket::AF_INET); sock.do_not_reverse_lookup = false; sock.connect("127.0.0.1", 2048); sock.peeraddr[2] }
LOCALHOST_HOSTNAME = LOCALHOST_HOSTNAME_GETTER.call
DUMMY_SOCK = Struct.new(:remote_host, :remote_addr, :remote_port).new(LOCALHOST_HOSTNAME_GETTER.call, "127.0.0.1", 0)
Copy link
Member

Choose a reason for hiding this comment

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

Use LOCALHOST_HOSTNAME instead of LOCALHOST_HOSTNAME_GETTER.call in new

Copy link
Member Author

Choose a reason for hiding this comment

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

ok.

@server.close
end
end
# class << self
Copy link
Member

Choose a reason for hiding this comment

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

Why keep these commented out code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I missed to delete these lines... will remove.

@tagomoris
Copy link
Member Author

I pushed commits for review comments. I'll merge this change after CI green.

@tagomoris tagomoris merged commit cbcdc5a into master Dec 21, 2016
@ganmacs ganmacs deleted the migrate-plugins-with-server-plugin-helper branch July 11, 2019 07:59
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