Comments (2)
Hey @sesa657547 👋 Here's how I'd do it:
input:
generate:
count: 1
mapping: |
root = [
{
"dId": "kjglsjglfkgfdkgfhjfhdsj",
"d1": "fhkfjsaf",
"d2": {
"dc1": 8,
"dc2": 9
},
"timestamp": "2020-09-03",
"A": [
{
"aId": "jflksflskgskg",
"af1": "kkfls",
"af2": {
"ac1": 6,
"ac2": 2
},
"af3": 1,
"af4": "00",
"af5": 4
}
],
"B": [
{
"bId": "jgljgldjgs",
"bf1": 6,
"bf2": {
"bc1": 4,
"bc2": 2
}
}
],
"C": [
{
"cId": "njfglsjg",
"cf1": 3,
"cf2": "jfgg"
}
]
}
]
processors:
- mapping: |
root = this.0.with("A", "B", "C").key_values()
- unarchive:
format: json_array
- mapping: |
meta key = this.key
root = this.value
output:
kafka:
# ...
topic: ${! @key }
# ...
I used the generate
input to show you how you can test this payload as a standalone example.
If A
, B
and C
aren't the actual topic names, you can massage them further using bloblang inside ${! ... }
, or if you just need to prepend / append some string to them, you can also do stuff like foo-${! @key }-bar
.
from benthos.
Moving to discussion (#2026)
from benthos.
Related Issues (20)
- Memeory not be released after all stream was finished HOT 4
- How to using parquet_encode the data from parquet_decode
- Pipeline that exit quickly do not always flush logs to redpanda topic HOT 2
- Examples of how to convert yaml complex types to CLI equivalent HOT 1
- shutdown_timeout does not take effect HOT 1
- Blob file from input_resource are not removed with "delete_objects: true" HOT 2
- CSV Scanner not working in SFTP context : extraneous or missing \" in quoted-field" HOT 1
- Add random jitter for cache ttl HOT 1
- Add metadata fields for messages from socket_server input
- Prometheus Metrics Pushgateway Error Format Issue HOT 3
- Consider swapping Goja with Sobek for Javascript Processor
- neo4j connector HOT 2
- documentation on how to implement custom connectors HOT 1
- Connection initialization failed only shows on TRACE not INFO level logs
- AWS S3 output fails to upload objects in partitioned path HOT 6
- Add support for NATS Object Store
- Add support for advanced kafka_franz options like MetadataMaxAge
- Add support for `EmitDefaultValues` in `protobuf` processor HOT 2
- Panic when encoding same batch as parquet across multiple outputs HOT 3
- Plans to support Salesforce as input/output?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from benthos.