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

Mark which field set reuses expect arrays #1736

Closed
ebeahan opened this issue Jan 20, 2022 · 0 comments · Fixed by #1838
Closed

Mark which field set reuses expect arrays #1736

ebeahan opened this issue Jan 20, 2022 · 0 comments · Fixed by #1838
Assignees

Comments

@ebeahan
Copy link
Member

ebeahan commented Jan 20, 2022

Purpose

Indicate in the field definitions when a field set reuse expects an array.

Background

Reuses allowing arrays may benefit specific limited use. However, there's currently no way to declare this reuse type in the ECS tooling.

{
  "process": {
    "previous" : [
      {
        "name": "abc.exe"
      },
      {
        "name": "xyz.exe"
      }
    ]
  }
}

The above basic example presents an ECS mapped event using field set array reuse. The previous object is process.* field set reused at process.previous.

The normalize: [ 'array' ] setting controls when a particular field expects an array of values. There's no dedicated array type in Elasticsearch, and any field can contain zero or more values of the same type. So when the array attribute is specified, a note is added by the generator script to that field's description in the ECS docs.

Field def setting:

    - name: example
      normalize:
        - array

Results in this text added to field's description:

Screen Shot 2022-01-20 at 1 06 36 PM

Proposed design

Implement a similar mechanism as leaf fields:

  • specify an attribute on a field reuse
  • have the asciidoc generator handle including that content in the field reuse description

Open question(s)

  • Do we reuse the existing normalize attribute convention? Or a simple bool parameter (e.g., is_array)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants