Skip to content
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

Make sure JSON parser returns Hash #4106

Closed

Commits on Apr 4, 2024

  1. Make sure JSON parser returns Hash

    It is wrong for Parser to return a record that is not Hash.
    Subsequent processing may result in errors.
    
    Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
    daipom authored and kenhys committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    d5c32e8 View commit details
    Browse the repository at this point in the history
  2. in_http supports Parser yield

    in_http didn't support yield of Parser.
    The specification assumed that Parser could return Array.
    However, this is wrong. Parser shouldn't return Array.
    
    Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
    daipom authored and kenhys committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    9516ef4 View commit details
    Browse the repository at this point in the history
  3. Add comment about limitation of filter_parser specification

    Config to reproduce:
    
        <source>
          @type sample
          tag test.array
          sample {"message": "[{\"k\":\"v\"}, {\"k2\":\"v2\"}]"}
        </source>
    
        <filter test.**>
          @type parser
          key_name message
          <parse>
            @type json
          </parse>
        </filter>
    
        <match test.**>
          @type stdout
        </match>
    
    Result:
    
        2023-03-21 23:24:52.004470792 +0900 test.array: {"k":"v"}
        2023-03-21 23:24:52.004470792 +0900 test.array: {"k":"v"}
        ...
    
    Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
    daipom authored and kenhys committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    940624e View commit details
    Browse the repository at this point in the history