# Logstash ability to check field value against file contents

**URL:** <https://discuss.elastic.co/t/logstash-ability-to-check-field-value-against-file-contents/63113>\
**Category:** Logstash\
**Created:** [October 15, 2016, 3:46pm UTC](https://discuss.elastic.co/t/logstash-ability-to-check-field-value-against-file-contents/63113 "2016-10-15T15:46:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Henderson](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@Justin\_Henderson](https://discuss.elastic.co/u/Justin_Henderson)\
**Post date:** [October 15, 2016, 3:46pm UTC](https://discuss.elastic.co/t/logstash-ability-to-check-field-value-against-file-contents/63113/1 "2016-10-15T15:46:51Z")

</div>

Does anyone know of a plugin that would allow checking a field's value against the contents of a file? I'm looking to do a simple boolean check and if true have the capability to add a tag or field.

This would allow tagging of events to aid in filtering in or out on events. For example, assume you have a DNS log that has [google.com](http://google.com) in it. It would be helpful to check [google.com](http://google.com) against the Alexa top 1 million and if found tag the log with alexa. This would allow easy filtering of logs of interest by filtering out anything tagged with alexa.

I know you can do this with the ruby plugin but the performance is terrible as it would reload the file every time ruby is invoked. If there is a plugin that when loaded buffers the file contents in memory this would be incredibly fast and used for similar concepts.

Anyone know of an existing way to do this?

---

<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 15, 2016, 3:52pm UTC](https://discuss.elastic.co/t/logstash-ability-to-check-field-value-against-file-contents/63113/2 "2016-10-15T15:52:56Z")

</div>

Sounds like the translate filter would be of use to you.

---

<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:** [July 6, 2017, 4:34am UTC](https://discuss.elastic.co/t/logstash-ability-to-check-field-value-against-file-contents/63113/3 "2017-07-06T04:34:05Z")

</div>


