-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
… 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.
@repeatedly Could you review this change? |
c1626d2
to
ddd7baa
Compare
@repeatedly ping |
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.
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) |
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.
add_source_info
or something is better.
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.
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) |
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.
Use LOCALHOST_HOSTNAME
instead of LOCALHOST_HOSTNAME_GETTER.call
in new
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.
ok.
@server.close | ||
end | ||
end | ||
# class << self |
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.
Why keep these commented out code?
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.
I missed to delete these lines... will remove.
I pushed commits for review comments. I'll merge this change after CI green. |
This change updates
in_syslog
andin_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.