Adding logstash IP address field when processing filter

Dear Elastic Community,

We are using several logstash servers behind a loadbalancer. All you client are sending their logs through those VIP created on the load balancer, not directly to the logstash servers. For the "beats", the load balancing is make by the beat itself, which contains the list of all logstash servers.

I would like to know if it is possible to add a field containing the logstash server IP address where the log ingestion has been processed from. If so, what would be the variable I need to add?

Thank you and best regards,
Yanick Quirion

See here.

Thanks Badger!

The correct code was next though:

     ruby {
        init => "require 'socket'"
        code => "event.set('logstash.hostname', Socket.gethostname)"
      }

Regards!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.