parser_syslog: string parser ends RFC5424 structured data at an escaped "]"
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in parse_rfc5424, where the issue says text.index('] ', cursor) finds the structured data boundary, and compare the string parser with the regexp parser using the supplied RFC5424 input. Trace the parser's existing tests and add a regression case for an escaped ] followed by a space. Done when extradata contains the complete structured data and message is msg.
Written by the indexing model from the issue text.
Description
Describe the bug
With parser_engine string, parser_syslog ends STRUCTURED-DATA at the first ] in the message. It does not check whether the ] is escaped. When a PARAM-VALUE contains \] followed by a space, the rest of the structured data goes into message.
RFC 5424 section 6.3.3 requires ] in a PARAM-VALUE to be escaped as \], so this is a valid message.
Input:
<14>1 2026-04-25T16:43:29.123Z host app 123 ID [x@1 a="b\] c"] msg
extradata |
message |
|
|---|---|---|
parser_engine string |
[x@1 a="b] |
c"] msg |
parser_engine regexp |
[x@1 a="b\] c"] |
msg |
To Reproduce
-
Create
/tmp/syslog.logwith this line:<14>1 2026-04-25T16:43:29.123Z host app 123 ID [x@1 a="b\] c"] msg -
Run Fluentd with the configuration below.
Expected behavior
extradata contains the whole structured data and message is msg, as with parser_engine regexp.
Actual output:
test: {"host":"host","ident":"app","pid":"123","msgid":"ID","pri":14,"extradata":"[x@1 a=\"b]","message":"c\"] msg"}
Your Environment
- Fluentd version: 1.20.1 (master at f55db4b1)
- Package version: N/A (from source)
- Operating system: CachyOS
- Kernel version: 7.3.1-1-cachyos
- Ruby: 4.0.9
Your Configuration
<source>
@type tail
path /tmp/syslog.log
pos_file /tmp/syslog.log.pos
read_from_head true
tag test
<parse>
@type syslog
message_format rfc5424
with_priority true
parser_engine string
</parse>
</source>
<match test>
@type stdout
</match>
Your Error Log
No error is logged. The record is emitted with wrong fields.
Additional context
parse_rfc5424 finds the end of the structured data with text.index('] ', cursor). This exists since v1.11.0.
- Dominant language
- Ruby
- Stars
- 13.6k
- Forks
- 1.4k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fluent/fluentd
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
fluent/fluentd#5494 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
BufferChunkOverflowError inside @ERROR loops forever - no buffer parameter can stop itMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
fluent/fluentd#5462 · 8 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nesquena/steward-os#79 ·
Maintainers usually reply within 1 day
-
[Bug] Time search attributes lose sub-second precision, and raise NoMethodError without `require 'time'`Possibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
temporalio/sdk-ruby#653 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
bridgetownrb/bridgetown#1134 ·
-
Go: a namespaced model's fixture file is loaded through `NewAdmin::Note()`, which doesn't parseOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rubys/roundhouse#1820 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swombat/souls-house#795 ·
Maintainers usually reply within 1 day