Closed MaxWk closed 3 years ago
inputs: - Stdin: codec: json filters: - Add: if: - 'Exist(a)' fields: c: $.a - Add: if: - '!Exist(a)' fields: c: $.b outputs: - Stdout: {}
% cat a.txt| gohangout --config gohangout.yml -exit-when-nil gohangout version 1.7.5 {"@timestamp":"2021-07-14T17:17:32.098875+08:00","a":10,"c":10} {"@timestamp":"2021-07-14T17:17:32.101337+08:00","b":20,"c":20} {"@timestamp":"2021-07-14T17:17:32.101399+08:00","a":10,"b":20,"c":10} {"@timestamp":"2021-07-14T17:17:32.101423+08:00","b":20,"c":20,"x":10} % cat a.txt {"a":10} {"b":20} {"a":10,"b":20} {"x":10,"b":20}