# Adding additional fields for Logstash Kinesis Input

**URL:** https://discuss.elastic.co/t/adding-additional-fields-for-logstash-kinesis-input/240542
**Category:** Logstash
**Created:** [July 9, 2020, 2:41pm UTC](https://discuss.elastic.co/t/adding-additional-fields-for-logstash-kinesis-input/240542 "2020-07-09T14:41:10Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Jenni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jenni/32/29684_2.png) [@Jenni](https://discuss.elastic.co/u/Jenni)
#### Post date: [July 9, 2020, 3:24pm UTC](https://discuss.elastic.co/t/adding-additional-fields-for-logstash-kinesis-input/240542/2 "2020-07-09T15:24:14Z")

</div>

This could help:

> [@How can I get the logstash hostname](https://discuss.elastic.co/t/how-can-i-get-the-logstash-hostname/51771/3):
>
> filter { ruby { init =\> "require 'socket'" code =\> "event['some-field-name'] = Socket.gethostname" } }

> [@Add Logstash host name to JSON formatted logstream](https://discuss.elastic.co/t/add-logstash-host-name-to-json-formatted-logstream/140567/4):
>
> You can use a json filter to parse that JSON string, but if that's not the hostname you're interested in perhaps it doesn't matter. I glanced at the logstash hostname link, and that makes sense, my only concern is does it make that socket call for every event is processed? Yes, but I'd expect it to be a cheap operation. Otherwise you should be able to fetch the hostname once when the filter initializes and reuse that value for each event. Something like this might work: ruby { init =\> " …

---

_[View the full topic](https://discuss.elastic.co/t/adding-additional-fields-for-logstash-kinesis-input/240542)._
