fluent / fluent/fluent-bit

empty fields will be removed when matched by regular expressions

Open
#1,471 9 comments 0 reactions 1 assignee Claimed by @edsiper View on GitHub
enhancement
Dominant language
C
Stars
8.1k
Forks
2k
Avg merge
4d 20h
Merged PRs (30d)
71

Description

## Bug Report

**Describe the bug**

our log is
07-26 13:12:14 759 main INFO []
By regular
(?^\d{2}-\d{2} \d{2}:\d{2}:\d{2} \d{3}) (?[^ ] +) (?[^ ]+) \[(?\w*)\]
After upgrading the version to 1.2, when the regular expression is matched, the empty field will be removed, and the generated json is
{"logtime":"07-26 13:12:14 759","threadPool":"main ","level":"INFO"}
But the fields will still be preserved in 0.13 version
{"logtime":"07-26 13:12:14 759","threadPool":"main","level":"INFO","sessionTid":""}, is there any configuration to control the empty field?

**To Reproduce**
- Rubular link if applicable:
- Example log message if applicable:
```
{"log":"YOUR LOG MESSAGE HERE","stream":"stdout","time":"2018-06-11T14:37:30.681701731Z"}
```
- Steps to reproduce the problem:

**Expected behavior**

**Screenshots**

**Your Environment**

* Version used:
* Configuration:
* Environment name and version (e.g. Kubernetes? What version?):
* Server type and version:
* Operating System and version:
* Filters and plugins:

**Additional context**

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.