Repository: redpanda-data/connect

Issue #1954: Query for Redis stuff
Created: 2023-06-13T05:13:34Z
HI,
i am running this config file , for pub sub key event notification .
while in redis i am trying to set value using this :
set namexyz '{"json": {"TrapId": "122", "NpuId": "0", "PacketDropped": 5, "PacketAccepted": 25},"ot":"1677690061.330262886"}'
OK
why am i not able to read up from the branch processor and write back to the original message?
benthos yaml :
input:
redis_pubsub:
url: redis://127.0.0.1:6379
channels: ["keyevent@0:*"]
use_patterns: true
pipeline:
processors:
- branch:
processors:
- redis:
url: redis://127.0.0.1:6379
command: get
#args_mapping: 'root = [ meta("namexyz") ]'
args_mapping: root = this.namexyz
result_map: root = this
- jq:
query : '.'
output:
stdout: {}
metrics:
prometheus: {}
mapping: ""
benthos-output:
INFO Running main config from specified file       @service=benthos path=/nobackup/shutewar/Redis_input/test_Redis_list1.yaml
INFO Listening for HTTP requests at: http://0.0.0.0:4195  @service=benthos
ERRO HTTP Server error: listen tcp 0.0.0.0:4195: bind: address already in use  @service=benthos
INFO Launching a benthos instance, use CTRL+C to close  @service=benthos
INFO Receiving Redis pub/sub messages from channels: [keyevent@0:*]  @service=benthos label="" path=root.input
ERRO Branch error: processors failed: args mapping failed: failed assignment (line 1): unable to reference message as structured (with 'this.namexyz'): parse as json: invalid character 'a' in literal null (expecting 'u')  @service=benthos label="" path=root.pipeline.processors.0
namexyz

Duplicate issue #1955: Not able to read data from Redis in branch processor and writing back to original message
Created: 2023-06-13T07:00:14Z
Hi everyone,
I am using Redis key-event notification with benthos.
I am running this config file , for pub sub key event notification .
while in redis i am trying to set value using this :
set namexyz '{"json": {"TrapId": "122", "NpuId": "0", "PacketDropped": 5, "PacketAccepted": 25},"ot":"1677690061.330262886"}'
OK

But I am i not able to read up from the branch processor and write back to the original message !
Benthos yaml :
input:
redis_pubsub:
url: redis://127.0.0.1:6379
channels: ["keyevent@0:*"]
use_patterns: true

pipeline:
processors:
- branch:
processors:
- redis:
url: redis://127.0.0.1:6379
command: get
#args_mapping: 'root = [ meta("namexyz") ]'
args_mapping: root = this.namexyz
result_map: root = this
- jq:
query : '.'
output:
stdout: {}
metrics:
prometheus: {}
mapping: ""

benthos-output:
INFO Running main config from specified file @service=benthos path=/nobackup/shutewar/Redis_input/test_Redis_list1.yaml
INFO Listening for HTTP requests at: http://0.0.0.0:4195/ @service=benthos
ERRO HTTP Server error: listen tcp 0.0.0.0:4195: bind: address already in use @service=benthos
INFO Launching a benthos instance, use CTRL+C to close @service=benthos
INFO Receiving Redis pub/sub messages from channels: [keyevent@0:*] @service=benthos label="" path=root.input
ERRO Branch error: processors failed: args mapping failed: failed assignment (line 1): unable to reference message as structured (with 'this.namexyz'): parse as json: invalid character 'a' in literal null (expecting 'u') @service=benthos label="" path=root.pipeline.processors.0
namexyz

Can anyone please help in this issue, I am stuck from a week in this ?
Thanks !

Closing comment (2023-06-13T07:14:26Z): Closing as I believe this is a duplicate of #1954