Skip to content

Commit

Permalink
one more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kvch committed Apr 20, 2021
1 parent 097b76f commit ab5df90
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions filebeat/input/filestream/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,34 @@ func TestPostProcessor(t *testing.T) {
},
},
},
"JSON post processer with overwrite keys and under root": {
message: reader.Message{
Fields: common.MapStr{
"json": common.MapStr{
"key": "value",
},
"key": "another-value",
"other-key": "other-value",
},
},
postProcessors: map[string]interface{}{
"paths": []string{"dummy_path"},
"parsers": []map[string]interface{}{
map[string]interface{}{
"ndjson": map[string]interface{}{
"keys_under_root": true,
"overwrite_keys": true,
},
},
},
},
expectedMessage: reader.Message{
Fields: common.MapStr{
"key": "value",
"other-key": "other-value",
},
},
},
}

for name, test := range tests {
Expand Down

0 comments on commit ab5df90

Please sign in to comment.