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

Bug when defining a custom log source with all custom table configurations #134

Open
shaeqahmed opened this issue Apr 17, 2023 · 0 comments

Comments

@shaeqahmed
Copy link
Contributor

Bug brought up in discord channel:

Was popping in because I had a quick question. Is it possible to configure tables with a custom log source? Couldn’t seem to get that working and when walking through the code

My setup looks something like this:

# /log_sources/customsource/log_source.yml
name: customsource

ingest:
  select_table_from_payload_metadata: |
    if match(.__metadata.s3.key, r'.*') {
      "mytable"
    }
  expand_records_from_payload: "parse_json!(.__raw)"

schema:
  ecs_field_names:
    - event.original

transform: |
  .event.original = encode_json(.json)
# /log_sources/customsource/tables/mytable.yml
name: "mytable"

schema:
  fields:
    - name: custom_field
      type: string

I expected it to create a mytable.yml schema, but instead it creates default.yml and ignores any configurations in my table.

The log-source.ts construct needs to be updated to properly pick up user configuration for custom log sources / tables.

shaeqahmed added a commit that referenced this issue Apr 18, 2023
…ions (#135)

Fix for #134

### Testing

Verified test locally with the customsource configuration provided by
user, it is picked up properly after this change.
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

No branches or pull requests

1 participant