I need to pass a field from filebeat to kafka viz. host which is nothing but the host name of the machine from the logs are read. Though Filebeat sends the hostname in the beat properties, I need this in a separate field so that it conforms to the kafka topic's expected schema. Right now, I have created a field as
Though this works, I would like to know if there is a better way of achieving this such as using any variable in beat itself. Any help will be appreciated.