elastic / elastic/crawler

join_as option that only grabs the first match

Open
#167 0 comments 2 reactions 0 assignees View on GitHub
complexity:low enhancement priority:low
Dominant language
Ruby
Stars
224
Forks
48
Avg merge
23h 16m
Merged PRs (30d)
18

Description

### Problem Description
When using an extraction rule, sometimes you may want to just grab the first match. But right now, a `join_as` is required, and the only options are array (`[ 'val1', 'val2', 'val3' ]`) or string (`'val1, val2, val3'`). I'd like a way to just get `'val1'` without needing to write an ingest pipeline to drop the extras.

It's possible that there's a general way to do this with CSS selectors, but a brief google didn't turn any up.

### Proposed Solution
add a 3rd option for the `join_as` config like `drop_extras` or `first_only` or `greedy` or `no_join_only_first`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.