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

     1  ---
     2  title: redis_hash
     3  type: output
     4  status: stable
     5  categories: ["Services"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/output/redis_hash.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  
    19  Sets Redis hash objects using the HMSET command.
    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  output:
    32    label: ""
    33    redis_hash:
    34      url: tcp://localhost:6379
    35      key: ""
    36      walk_metadata: false
    37      walk_json_object: false
    38      fields: {}
    39      max_in_flight: 1
    40  ```
    41  
    42  </TabItem>
    43  <TabItem value="advanced">
    44  
    45  ```yaml
    46  # All config fields, showing default values
    47  output:
    48    label: ""
    49    redis_hash:
    50      url: tcp://localhost:6379
    51      kind: simple
    52      master: ""
    53      tls:
    54        enabled: false
    55        skip_cert_verify: false
    56        enable_renegotiation: false
    57        root_cas: ""
    58        root_cas_file: ""
    59        client_certs: []
    60      key: ""
    61      walk_metadata: false
    62      walk_json_object: false
    63      fields: {}
    64      max_in_flight: 1
    65  ```
    66  
    67  </TabItem>
    68  </Tabs>
    69  
    70  The field `key` supports
    71  [interpolation functions](/docs/configuration/interpolation#bloblang-queries), allowing
    72  you to create a unique key for each message.
    73  
    74  The field `fields` allows you to specify an explicit map of field
    75  names to interpolated values, also evaluated per message of a batch:
    76  
    77  ```yaml
    78  output:
    79    redis_hash:
    80      url: tcp://localhost:6379
    81      key: ${!json("id")}
    82      fields:
    83        topic: ${!meta("kafka_topic")}
    84        partition: ${!meta("kafka_partition")}
    85        content: ${!json("document.text")}
    86  ```
    87  
    88  If the field `walk_metadata` is set to `true` then Benthos
    89  will walk all metadata fields of messages and add them to the list of hash
    90  fields to set.
    91  
    92  If the field `walk_json_object` is set to `true` then
    93  Benthos will walk each message as a JSON object, extracting keys and the string
    94  representation of their value and adds them to the list of hash fields to set.
    95  
    96  The order of hash field extraction is as follows:
    97  
    98  1. Metadata (if enabled)
    99  2. JSON object (if enabled)
   100  3. Explicit fields
   101  
   102  Where latter stages will overwrite matching field names of a former stage.
   103  
   104  ## Performance
   105  
   106  This output benefits from sending multiple messages in flight in parallel for
   107  improved performance. You can tune the max number of in flight messages with the
   108  field `max_in_flight`.
   109  
   110  ## Fields
   111  
   112  ### `url`
   113  
   114  The URL of the target Redis server. Database is optional and is supplied as the URL path. The scheme `tcp` is equivalent to `redis`.
   115  
   116  
   117  Type: `string`  
   118  Default: `"tcp://localhost:6379"`  
   119  
   120  ```yaml
   121  # Examples
   122  
   123  url: :6397
   124  
   125  url: localhost:6397
   126  
   127  url: redis://localhost:6379
   128  
   129  url: redis://:foopassword@redisplace:6379
   130  
   131  url: redis://localhost:6379/1
   132  
   133  url: redis://localhost:6379/1,redis://localhost:6380/1
   134  ```
   135  
   136  ### `kind`
   137  
   138  Specifies a simple, cluster-aware, or failover-aware redis client.
   139  
   140  
   141  Type: `string`  
   142  Default: `"simple"`  
   143  
   144  ```yaml
   145  # Examples
   146  
   147  kind: simple
   148  
   149  kind: cluster
   150  
   151  kind: failover
   152  ```
   153  
   154  ### `master`
   155  
   156  Name of the redis master when `kind` is `failover`
   157  
   158  
   159  Type: `string`  
   160  Default: `""`  
   161  
   162  ```yaml
   163  # Examples
   164  
   165  master: mymaster
   166  ```
   167  
   168  ### `tls`
   169  
   170  Custom TLS settings can be used to override system defaults.
   171  
   172  **Troubleshooting**
   173  
   174  Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you're using TLS and are seeing connectivity problems consider setting `enable_renegotiation` to `true`, and ensuring that the server supports at least TLS version 1.2.
   175  
   176  
   177  Type: `object`  
   178  
   179  ### `tls.enabled`
   180  
   181  Whether custom TLS settings are enabled.
   182  
   183  
   184  Type: `bool`  
   185  Default: `false`  
   186  
   187  ### `tls.skip_cert_verify`
   188  
   189  Whether to skip server side certificate verification.
   190  
   191  
   192  Type: `bool`  
   193  Default: `false`  
   194  
   195  ### `tls.enable_renegotiation`
   196  
   197  Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message `local error: tls: no renegotiation`.
   198  
   199  
   200  Type: `bool`  
   201  Default: `false`  
   202  Requires version 3.45.0 or newer  
   203  
   204  ### `tls.root_cas`
   205  
   206  An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
   207  
   208  
   209  Type: `string`  
   210  Default: `""`  
   211  
   212  ```yaml
   213  # Examples
   214  
   215  root_cas: |-
   216    -----BEGIN CERTIFICATE-----
   217    ...
   218    -----END CERTIFICATE-----
   219  ```
   220  
   221  ### `tls.root_cas_file`
   222  
   223  An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
   224  
   225  
   226  Type: `string`  
   227  Default: `""`  
   228  
   229  ```yaml
   230  # Examples
   231  
   232  root_cas_file: ./root_cas.pem
   233  ```
   234  
   235  ### `tls.client_certs`
   236  
   237  A list of client certificates to use. For each certificate either the fields `cert` and `key`, or `cert_file` and `key_file` should be specified, but not both.
   238  
   239  
   240  Type: `array`  
   241  Default: `[]`  
   242  
   243  ```yaml
   244  # Examples
   245  
   246  client_certs:
   247    - cert: foo
   248      key: bar
   249  
   250  client_certs:
   251    - cert_file: ./example.pem
   252      key_file: ./example.key
   253  ```
   254  
   255  ### `tls.client_certs[].cert`
   256  
   257  A plain text certificate to use.
   258  
   259  
   260  Type: `string`  
   261  Default: `""`  
   262  
   263  ### `tls.client_certs[].key`
   264  
   265  A plain text certificate key to use.
   266  
   267  
   268  Type: `string`  
   269  Default: `""`  
   270  
   271  ### `tls.client_certs[].cert_file`
   272  
   273  The path to a certificate to use.
   274  
   275  
   276  Type: `string`  
   277  Default: `""`  
   278  
   279  ### `tls.client_certs[].key_file`
   280  
   281  The path of a certificate key to use.
   282  
   283  
   284  Type: `string`  
   285  Default: `""`  
   286  
   287  ### `key`
   288  
   289  The key for each message, function interpolations should be used to create a unique key per message.
   290  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   291  
   292  
   293  Type: `string`  
   294  Default: `""`  
   295  
   296  ```yaml
   297  # Examples
   298  
   299  key: ${!meta("kafka_key")}
   300  
   301  key: ${!json("doc.id")}
   302  
   303  key: ${!count("msgs")}
   304  ```
   305  
   306  ### `walk_metadata`
   307  
   308  Whether all metadata fields of messages should be walked and added to the list of hash fields to set.
   309  
   310  
   311  Type: `bool`  
   312  Default: `false`  
   313  
   314  ### `walk_json_object`
   315  
   316  Whether to walk each message as a JSON object and add each key/value pair to the list of hash fields to set.
   317  
   318  
   319  Type: `bool`  
   320  Default: `false`  
   321  
   322  ### `fields`
   323  
   324  A map of key/value pairs to set as hash fields.
   325  This field supports [interpolation functions](/docs/configuration/interpolation#bloblang-queries).
   326  
   327  
   328  Type: `object`  
   329  Default: `{}`  
   330  
   331  ### `max_in_flight`
   332  
   333  The maximum number of messages to have in flight at a given time. Increase this to improve throughput.
   334  
   335  
   336  Type: `int`  
   337  Default: `1`  
   338  
   339