fluent / fluent/fluentd

Json parser can not apply `null_value_pattern` to nested values

Open
#4,222 18 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Ruby
Stars
13.6k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
20

Description

### Describe the bug

Json parser not respecting `null_value_pattern` for nested values

### To Reproduce

https://github.com/fluent/fluentd/issues/4222#issuecomment-1627874181

old

```
{msg: "foo", "ConfigMap/logging/fluentd-config":"unchanged","ConfigMap/logging/index-template":"unchanged"}
```
`null_value_pattern unchanged` should produce:
```
{msg: "foo"}
```

### Expected behavior

Field with value `unchanged` should be discarded.

### Your Environment

```markdown
- Fluentd version: v1.15.3-debian
- TD Agent version: n/a
- Operating system:
- Kernel version: AWS EKS
```

### Your Configuration

```apache

@id parser_flux
@type parser
key_name "log"
reserve_data true
remove_key_name_field true
inject_key_prefix "log_"
emit_invalid_record_to_error false

@type "json"
null_value_pattern unchanged

```
```

### Your Error Log

```shell
No errors
```

### Additional context

I'm trying to discard a large number of fields (list is dynamic) with anything of value `unchanged`. alternative approaches welcome.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.