Skip to content

Vector Unit Testing - Cant send or parse array/json elements directly #12086

Answered by jszwedko
satscreate asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @satscreate !

The issue here is that you are passing in a raw string where the actual topology will parse the string as JSON due to setting decoding.codec = "json" on the stdin source.

As you note, there is a bug prohibiting arrays to be used as fields that is being tracked by #9386

You can, however, flatten out the object keys like this:

  - name: validate-result-log-block
    inputs:
      - insert_at: filter-empty
        type: log
        log_fields:
          host: "0.0"
          source: test
          id: testid
          recorded: date
          message: some message
          actors[0].type: user
          actors[0].name: somename
          actors[0].id: someid
          resou…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@satscreate
Comment options

@jszwedko
Comment options

Answer selected by jszwedko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants