github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/conditions/json.md (about) 1 --- 2 title: json 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/json.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 json: 32 operator: exists 33 path: "" 34 arg: "" 35 ``` 36 37 </TabItem> 38 <TabItem value="advanced"> 39 40 ```yaml 41 # All config fields, showing default values 42 json: 43 operator: exists 44 path: "" 45 arg: "" 46 part: 0 47 ``` 48 49 </TabItem> 50 </Tabs> 51 52 ## Fields 53 54 ### `operator` 55 56 A logical [operator](#operators) to check with. 57 58 59 Type: `string` 60 Default: `"exists"` 61 Options: `exists`, `equals`, `contains`. 62 63 ### `path` 64 65 The [path](/docs/configuration/field_paths) of a specific field within JSON documents to check. 66 67 68 Type: `string` 69 Default: `""` 70 71 ### `arg` 72 73 An argument to check against. May not be applicable for all operators. 74 75 76 Type: `string` 77 Default: `""` 78 79 ### `part` 80 81 The index of a message within a batch to test the condition against. This 82 field is only applicable when batching messages 83 [at the input level](/docs/configuration/batching). 84 85 Indexes can be negative, and if so the part will be selected from the end 86 counting backwards starting from -1. 87 88 89 Type: `number` 90 Default: `0` 91 92 ## Alternatives 93 94 Consider using the [bloblang](/docs/components/conditions/bloblang) condition 95 instead as it offers a wide range of json processing options. For example, the 96 following condition: 97 98 ``` yaml 99 json: 100 operator: equals 101 path: foo 102 arg: bar 103 ``` 104 105 Can instead be expressed with: 106 107 ``` yaml 108 bloblang: 'this.foo == "bar"' 109 ``` 110