# Logstash Filter Conditional Usage

**URL:** <https://discuss.elastic.co/t/logstash-filter-conditional-usage/185284>\
**Category:** Logstash\
**Created:** [June 11, 2019, 9:47pm UTC](https://discuss.elastic.co/t/logstash-filter-conditional-usage/185284 "2019-06-11T21:47:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Chirillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tony_chirillo/32/22647_2.png) [@Tony\_Chirillo](https://discuss.elastic.co/u/Tony_Chirillo)\
**Post date:** [June 11, 2019, 9:47pm UTC](https://discuss.elastic.co/t/logstash-filter-conditional-usage/185284/1 "2019-06-11T21:47:16Z")

</div>

I am trying to code my filter to drop an event when three specific fields contain the text "Other", but cant seem to get events actually to drop. Here is the statement I am using, do I have the syntax and format correct? If not, please let me know what I did wrong.

if [ua.device] == "Other" and [ua.name] == "Other" and [ua.os] == "Other" { drop { id=\> "drop noisy EWS chatter" } }

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 11, 2019, 10:30pm UTC](https://discuss.elastic.co/t/logstash-filter-conditional-usage/185284/2 "2019-06-11T22:30:37Z")

</div>

[ua.device] references a field with a dot in its name. [ua][device] reference an object that contains a field called device. You most likely want the latter.

---

<div class="post-metadata">

**Author:** ![Tony\_Chirillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tony_chirillo/32/22647_2.png) [@Tony\_Chirillo](https://discuss.elastic.co/u/Tony_Chirillo)\
**Post date:** [June 12, 2019, 1:36pm UTC](https://discuss.elastic.co/t/logstash-filter-conditional-usage/185284/3 "2019-06-12T13:36:58Z")

</div>

Awesome, that took care of it! Thanks for the consult!!

---

<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 10, 2019, 1:36pm UTC](https://discuss.elastic.co/t/logstash-filter-conditional-usage/185284/4 "2019-07-10T13:36:58Z")

</div>

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