Skip to content

Conversation

@agup006
Copy link
Member

@agup006 agup006 commented May 20, 2025

Summary

  • allow Parser filter to parse nested keys using record accessor patterns
  • clean up parser context on exit

Testing

  • cmake .. -DFLB_TESTS_INTERNAL=Off -DFLB_TESTS_RUNTIME=Off
  • make -j$(nproc)
  • ctest --output-on-failure

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for record accessor patterns in the parser filter by integrating record accessor functionality and ensuring proper cleanup of parser context.

  • Added header includes and a new ra_key field for record accessor support in the filter_parser_ctx structure.
  • Updated the configuration and filtering functions to create and use ra_key when keys start with '$'.
  • Ensured that the ra_key is destroyed during filter exit for proper resource cleanup.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugins/filter_parser/filter_parser.h Added necessary includes and a new field for record accessor support.
plugins/filter_parser/filter_parser.c Configured record accessor creation, usage in filtering, and cleanup on exit.
Comments suppressed due to low confidence (1)

plugins/filter_parser/filter_parser.c:262

  • [nitpick] Consider renaming 'rval' to 'ra_value' for better clarity, as it represents a record accessor value.
rval = flb_ra_get_value_object(ctx->ra_key, *obj);

}
ctx->key_name_len = flb_sds_len(ctx->key_name);

if (ctx->key_name && ctx->key_name[0] == '$') {
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a brief comment here to explain that keys starting with '$' are processed as record accessor patterns.

Copilot uses AI. Check for mistakes.
@agup006 agup006 marked this pull request as ready for review May 20, 2025 17:49
@agup006 agup006 closed this May 20, 2025
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.

1 participant