# Dynamic Input for drop plugin

**URL:** <https://discuss.elastic.co/t/dynamic-input-for-drop-plugin/176649>\
**Category:** Logstash\
**Created:** [April 12, 2019, 2:38pm UTC](https://discuss.elastic.co/t/dynamic-input-for-drop-plugin/176649 "2019-04-12T14:38:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adireddi77](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@adireddi77](https://discuss.elastic.co/u/adireddi77)\
**Post date:** [April 12, 2019, 2:38pm UTC](https://discuss.elastic.co/t/dynamic-input-for-drop-plugin/176649/1 "2019-04-12T14:38:34Z")

</div>

I am new to Logstash. Have a json input, I am trying to filter the content before I write the output to a file. Below is my filter --  
filter {  
if [msg] != "null" {  
mutate {  
remove\_field =\> ["msg"]  
}  
}  
if [rawmsg] != "null" {  
mutate {  
remove\_field =\> ["rawmsg"]  
}  
}  
if [json][action] == "/abc/process/ready" or [json][action] == "/abc/metrics/get-all" or if [json][action] == "/abc/xyz/entries/merge" {  
drop{}  
}  
}

[json][action] element values in the if blocks can change over time so I would like to define a template file containing the list of values that can be managed by the end users and consumed by the filter. Is there a way to simple way to achieve this ? Thanks

---

<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:** [April 12, 2019, 3:00pm UTC](https://discuss.elastic.co/t/dynamic-input-for-drop-plugin/176649/2 "2019-04-12T15:00:06Z")

</div>

> [@adireddi77](#):
>
> [json][action] element values in the if blocks can change over time so I would like to define a template file containing the list of values that can be managed by the end users and consumed by the filter.

You could use a [translate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html) filter to lookup the value of [json][action] and add another field that you can test when deciding whether to do the drop.

---

<div class="post-metadata">

**Author:** ![adireddi77](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@adireddi77](https://discuss.elastic.co/u/adireddi77)\
**Post date:** [April 12, 2019, 5:53pm UTC](https://discuss.elastic.co/t/dynamic-input-for-drop-plugin/176649/3 "2019-04-12T17:53:13Z")

</div>

Thanks I will look into it.

---

<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:** [May 10, 2019, 5:53pm UTC](https://discuss.elastic.co/t/dynamic-input-for-drop-plugin/176649/4 "2019-05-10T17:53:33Z")

</div>

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