ixixi / fluent-plugin-record_splitter Goto Github PK
View Code? Open in Web Editor NEWOutput split array plugin for fluentd
Output split array plugin for fluentd
First - thanks for this module. It has been quite useful.
I was wondering if there was an option for when the record was split, if the original record field could be preserved? To be more specific, I have a record that looks like this:
{
"key1": "data1",
"key2": "data2",
"key3": {
"key4": "data4",
"key5": "data5"
},
"items": [
{
"key6": "data6",
"key7": "data7"
},
{
"key8": "data8",
"key9": "data9",
"key10": "data10"
}
],
"key11": "data11"
}
A few notes: The elements inside the 'items' key are dictionaries, and do not neccessarily have the same keys (or even number of keys) inside them. They may or may not be overlap in the keys between dictionaries. In this example, they do not, but there is nothing stopping 'key6' also being present in the key8-10 dictionary with the same or different value than 'data6'.
I am trying to split_key on 'items'. If I do so, then I think this is the result (with keep_other_key true
):
{
"key1": "data1",
"key2": "data2",
"key3": {
"key4": "data4",
"key5": "data5"
},
"key6": "data6",
"key7": "data7",
"key11": "data11"
},
{
"key1": "data1",
"key2": "data2",
"key3": {
"key4": "data4",
"key5": "data5"
},
"key8": "data8",
"key9": "data9",
"key10": "data10",
"key11": "data11"
}
However, it totally removed all reference to 'items'. Ideally, I would just swap that to a dictionary (which now only has one 'entry'), like so:
{
"key1": "data1",
"key2": "data2",
"key3": {
"key4": "data4",
"key5": "data5"
},
"items": {
"key6": "data6",
"key7": "data7"
},
"key11": "data11"
},
{
"key1": "data1",
"key2": "data2",
"key3": {
"key4": "data4",
"key5": "data5"
},
"items": {
"key8": "data8",
"key9": "data9",
"key10": "data10"
},
"key11": "data11"
}
Do you have any suggestion on how I might do that or some way of enhancing this module to support that?
When I follow the instructions to use the plugin with fluentd v1.4, I get this error message:
fluentd_1 | 2019-05-23 12:06:22 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="Unknown filter plugin 'record_splitter'. Run 'gem search -rd fluent-plugin' to find plugins"
docker-elk_fluentd_1 exited with code 1
Is it maybe related to fluent/fluentd#1826?
Appears due to the new fluentd , this error now pops up:
[warn]: emit transaction failed: error_class=RuntimeError error="BUG: use router.emit instead of Engine.emit"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.