Fluentd filter plugin annotate types. Annotates json object end value to avoid conflicts with random overlaping data.
$ gem install fluent-plugin-flatten-types
<filter **>
@type flatten_types
</filter>
{
"name": "junaid",
"type": 20,
"values": [1, "2323", { "name": "randy" }],
"random_json": {
"__str__": true,
"response": {
"code": "AX12312",
"message": "Cannot parse"
}
}
}
{
"name_s": "junaid",
"type_n": 20,
"values_a": [{ "v_n": 1 }, { "v_n": "2323" }, { "v": { "name": "randy" } }],
"random_json_s": "{\"__str__\":true,\"response\":{\"code\":\"AX12312\",\"message\":\"Cannot parse\"}}"
}
type | example | tranform |
---|---|---|
number | "type": 20 |
"type_n": 20 |
string | "name": "kaleo" |
"name_s": "kaleo" |
array | "values": [...] |
"values_a": [...] |
array[element] | [2, "3"] |
[{ "v_n" : 2 }, {"v_s": "3"}] |
boolean | "is_enabled": false |
"is_enabled_b": false |
map | "object": {} |
"object": {} |
Additional feature.
setting __str__
to true
in any map will stringify the map
- Copyright(c) 2020- junaid [email protected]
- License
- Apache License, Version 2.0