Skip to content

filter_parser: add record accessor support in parser filter #10366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

agup006
Copy link
Member

@agup006 agup006 commented May 20, 2025

This PR authored by OpenAI Codex Agent introduces the ability to use the record accessor syntax within the filter parser. The record accessor syntax allows users to select nested fields via a specific format

#10364
#10330


Testing
Before we can approve your change; please submit the following in a comment:

Example configuration file

service:
  flush: 1
  log_level: info

pipeline:
  inputs:
    - name: dummy
      dummy: '{"message": "hi", "nested": {"key1":"bye"}}'

  filters:
    - name: parser
      match: "*"
      parser: try
      key_name: $nested['key1']

  outputs:
    - name: stdout
      match: "*"

parsers:
   - name: json
     format: json

   - name: try
     format: regex
     regex: ^(?<extracted>.*)$
  • Attached Valgrind output that shows no leaks or memory corruption was found
SUCCESS: All unit tests have passed.
==93006==
==93006== HEAP SUMMARY:
==93006== in use at exit: 0 bytes in 0 blocks
==93006== total heap usage: 30,489 allocs, 30,489 frees, 14,191,579 bytes allocated
==93006==
==93006== All heap blocks were freed -- no leaks are possible
==93006==
==93006== For lists of detected and suppressed errors, rerun with: -s
==93006== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants