# Select output plugin based on a field

**URL:** <https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210>\
**Category:** Logstash\
**Created:** [September 20, 2017, 4:25pm UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210 "2017-09-20T16:25:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ram\_Sharan\_Mittal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_sharan_mittal/32/47018_2.png) [@Ram\_Sharan\_Mittal](https://discuss.elastic.co/u/Ram_Sharan_Mittal)\
**Post date:** [September 20, 2017, 4:25pm UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210/1 "2017-09-20T16:25:15Z")

</div>

In my requirement, event have to send to different output plugin based on a field in input

---

<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:** [September 20, 2017, 6:32pm UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210/2 "2017-09-20T18:32:02Z")

</div>

This will feed to different outputs based on the 'type' field.

```
output{
        if [type] != "dots" {
                stdout{ codec=>"rubydebug" }
        } else {
                stdout{ codec=>"dots" }
        }
}
```

---

<div class="post-metadata">

**Author:** ![MakaylaEady](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@MakaylaEady](https://discuss.elastic.co/u/MakaylaEady)\
**Post date:** [September 22, 2017, 6:21am UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210/3 "2017-09-22T06:21:41Z")

</div>

In the event that you intend to influence reasonable sounding to pop or shake, my recommendation is run with a multi-inspected drum pack. On the off chance that you intend to influence hip bounce or electronic music, to begin with a unit of one-hit tests. Most DAWs accompany the two sorts of drums. Mostly [Thesis Help | ThesisHelpSquad.co.uk](http://www.thesishelpsquad.co.uk) for using new methods.

---

<div class="post-metadata">

**Author:** ![Ram\_Sharan\_Mittal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_sharan_mittal/32/47018_2.png) [@Ram\_Sharan\_Mittal](https://discuss.elastic.co/u/Ram_Sharan_Mittal)\
**Post date:** [September 24, 2017, 6:46pm UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210/4 "2017-09-24T18:46:52Z")

</div>

I can't use this:  
input  
{stdin {codec =\> json}}

output{

```
            stdout{ codec=>

```

{if {[type] != "dots"} "rubydebug"  
else "dots" }  
}

is this some kind of data structure of ruby or logstash format?

---

<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:** [September 24, 2017, 8:35pm UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210/5 "2017-09-24T20:35:03Z")

</div>

You can't use conditionals inside plugin definitions.

---

<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:** [October 22, 2017, 8:35pm UTC](https://discuss.elastic.co/t/select-output-plugin-based-on-a-field/101210/6 "2017-10-22T20:35:40Z")

</div>

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