# Properties file read in Logstash

**URL:** <https://discuss.elastic.co/t/properties-file-read-in-logstash/102477>\
**Category:** Logstash\
**Created:** [October 2, 2017, 7:42pm UTC](https://discuss.elastic.co/t/properties-file-read-in-logstash/102477 "2017-10-02T19:42:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kant.gaurav](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kant.gaurav](https://discuss.elastic.co/u/kant.gaurav)\
**Post date:** [October 2, 2017, 7:42pm UTC](https://discuss.elastic.co/t/properties-file-read-in-logstash/102477/1 "2017-10-02T19:42:43Z")

</div>

my scenario is  
I have a property file. in which data is in below format  
key = value  
abc=123  
xyz=456

in logstash when I am processing logs, each log line has a key. Now I need to add a field whose value is from properties file based on key from log.

For Ex.  
log has key "abc". while processing logs, logstash should add field value "123". if it is "xyz" then value should be 456  
I am using version 5.4.1

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 3, 2017, 5:16am UTC](https://discuss.elastic.co/t/properties-file-read-in-logstash/102477/2 "2017-10-03T05:16:09Z")

</div>

Have a look at the translate filter. It won't read property files but it's trivial to convert a property file into a format that it does accept.

---

<div class="post-metadata">

**Author:** ![kant.gaurav](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kant.gaurav](https://discuss.elastic.co/u/kant.gaurav)\
**Post date:** [October 4, 2017, 4:40pm UTC](https://discuss.elastic.co/t/properties-file-read-in-logstash/102477/3 "2017-10-04T16:40:34Z")

</div>

Thanks for your reply. it worked for me.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 1, 2017, 4:41pm UTC](https://discuss.elastic.co/t/properties-file-read-in-logstash/102477/4 "2017-11-01T16:41:14Z")

</div>

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