X-Forwarded-For? The beats will add their hostname to the messages they forward, and the syslog input should be adding a [host] field that contains the ip address the message was received from.
If you want the name of the server running logstash you could try something like
ruby {
init => "require 'socket'"
code => "event.set('some field', Socket.gethostname)"
}