github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/conditions/resource.md (about) 1 --- 2 title: resource 3 type: condition 4 status: stable 5 --- 6 7 <!-- 8 THIS FILE IS AUTOGENERATED! 9 10 To make changes please edit the contents of: 11 lib/condition/resource.go 12 --> 13 14 import Tabs from '@theme/Tabs'; 15 import TabItem from '@theme/TabItem'; 16 17 18 Runs a condition resource by its name. This condition allows you to run the same 19 configured condition resource in multiple processors, or as a branch of another 20 condition. 21 22 ```yaml 23 # Config fields, showing default values 24 resource: "" 25 ``` 26 27 ## Examples 28 29 Let's imagine we have two outputs, one of which only receives messages that 30 satisfy a condition and the other receives the logical NOT of that same 31 condition. In this example we can save ourselves the trouble of configuring the 32 same condition twice by referring to it as a resource, like this: 33 34 ``` yaml 35 output: 36 broker: 37 pattern: fan_out 38 outputs: 39 - type: foo 40 processors: 41 - filter: 42 resource: foobar 43 - type: bar 44 processors: 45 - filter: 46 not: 47 resource: foobar 48 resources: 49 conditions: 50 foobar: 51 bloblang: 'this.from(1) == "filter me please"' 52 ``` 53