github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/processors/conditional.md (about)

     1  ---
     2  title: conditional
     3  type: processor
     4  status: deprecated
     5  ---
     6  
     7  <!--
     8       THIS FILE IS AUTOGENERATED!
     9  
    10       To make changes please edit the contents of:
    11       lib/processor/conditional.go
    12  -->
    13  
    14  import Tabs from '@theme/Tabs';
    15  import TabItem from '@theme/TabItem';
    16  
    17  :::warning DEPRECATED
    18  This component is deprecated and will be removed in the next major version release. Please consider moving onto [alternative components](#alternatives).
    19  :::
    20  
    21  Executes a set of child processors when a [condition](/docs/components/conditions/about)
    22  passes for a message batch, otherwise a different set of processors are applied.
    23  
    24  ```yaml
    25  # Config fields, showing default values
    26  label: ""
    27  conditional:
    28    condition:
    29      type: text
    30      text:
    31        arg: ""
    32        operator: equals_cs
    33        part: 0
    34    processors: []
    35    else_processors: []
    36  ```
    37  
    38  ## Alternatives
    39  
    40  All functionality of this processor has been superseded by the
    41  [switch](/docs/components/processors/switch) processor.
    42  
    43  Conditional is a processor that has a list of child `processors`,
    44  `else_processors`, and a `condition`. For each message batch, if the
    45  condition passes, the child `processors` will be applied, otherwise
    46  the `else_processors` are applied.
    47  
    48  In order to conditionally process each message of a batch individually use this
    49  processor with the [`for_each`](/docs/components/processors/for_each) processor.
    50  
    51  ## Fields
    52  
    53  ### `condition`
    54  
    55  The [`condition`](/docs/components/conditions/about) to check against messages.
    56  
    57  
    58  Type: `condition`  
    59  
    60  ### `processors`
    61  
    62  A list of processors to apply when the condition passes.
    63  
    64  
    65  Type: `array`  
    66  Default: `[]`  
    67  
    68  ### `else_processors`
    69  
    70  A list of processors to apply when the condition does not pass.
    71  
    72  
    73  Type: `array`  
    74  Default: `[]`  
    75  
    76