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

     1  ---
     2  title: metadata
     3  type: condition
     4  status: deprecated
     5  ---
     6  
     7  <!--
     8       THIS FILE IS AUTOGENERATED!
     9  
    10       To make changes please edit the contents of:
    11       lib/condition/metadata.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  
    22  <Tabs defaultValue="common" values={[
    23    { label: 'Common', value: 'common', },
    24    { label: 'Advanced', value: 'advanced', },
    25  ]}>
    26  
    27  <TabItem value="common">
    28  
    29  ```yaml
    30  # Common config fields, showing default values
    31  metadata:
    32    operator: equals_cs
    33    key: ""
    34    arg: ""
    35  ```
    36  
    37  </TabItem>
    38  <TabItem value="advanced">
    39  
    40  ```yaml
    41  # All config fields, showing default values
    42  metadata:
    43    operator: equals_cs
    44    key: ""
    45    arg: ""
    46    part: 0
    47  ```
    48  
    49  </TabItem>
    50  </Tabs>
    51  
    52  ## Fields
    53  
    54  ### `operator`
    55  
    56  An [operator](#operators) to apply.
    57  
    58  
    59  Type: `string`  
    60  Default: `"equals_cs"`  
    61  
    62  ### `key`
    63  
    64  The key of the metadata field to check.
    65  
    66  
    67  Type: `string`  
    68  Default: `""`  
    69  
    70  ### `arg`
    71  
    72  An argument to check against. For some operators this field not be required.
    73  
    74  
    75  Type: `string`  
    76  Default: `""`  
    77  
    78  ### `part`
    79  
    80  The index of a message within a batch to test the condition against. This
    81  field is only applicable when batching messages
    82  [at the input level](/docs/configuration/batching).
    83  
    84  Indexes can be negative, and if so the part will be selected from the end
    85  counting backwards starting from -1.
    86  
    87  
    88  Type: `number`  
    89  Default: `0`  
    90  
    91  ## Alternatives
    92  
    93  Consider using the [bloblang](/docs/components/conditions/bloblang) condition
    94  instead as it offers a wide range of metadata processing options. For example,
    95  the following condition:
    96  
    97  ``` yaml
    98  metadata:
    99    operator: enum
   100    key: foo
   101    arg:
   102      - bar
   103      - baz
   104      - qux
   105      - quux
   106  ```
   107  
   108  Can instead be expressed with:
   109  
   110  ``` yaml
   111  bloblang: '["bar","baz","qux","quux"].contains(meta("foo"))'
   112  ```
   113