Skip to content

Allow decoders mix plugin and multiregex children#602

Merged
albertomn86 merged 1 commit into3.3from
3.3-multiregex-plugin
May 8, 2018
Merged

Allow decoders mix plugin and multiregex children#602
albertomn86 merged 1 commit into3.3from
3.3-multiregex-plugin

Conversation

@vikman90
Copy link
Member

@vikman90 vikman90 commented May 8, 2018

The goal is to allow a regex extend the fields decoded by a plugin decoder like JSON.

Example:

<decoder name="json">
  <prematch>^{\s*"</prematch>
</decoder>

<decoder name="json_child">
  <parent>json</parent>
  <prematch>^{\s*"</prematch>
  <plugin_decoder>JSON_Decoder</plugin_decoder>
</decoder>

<decoder name="json_child">
  <parent>json</parent>
  <regex>@(\S+)"</regex>
  <order>user.email.domain</order>
</decoder>

With this input:

{
  "user": {
    "name": "John",
    "surname": "Smith",
    "email": "john.smith@example.com"
  }
}

The decoder will extract the complete JSON plus the domain of the email:

decoder: 'json'
user.name: 'John'
user.surname: 'Smith'
user.email: 'john.smith@example.com'
user.email.domain: 'example.com'

@vikman90 vikman90 added the type/enhancement New feature or request label May 8, 2018
@vikman90 vikman90 self-assigned this May 8, 2018
@vikman90 vikman90 requested a review from albertomn86 May 8, 2018 05:32
@vikman90 vikman90 force-pushed the 3.3-multiregex-plugin branch from 1934db9 to eb9dc72 Compare May 8, 2018 05:44
@albertomn86 albertomn86 merged commit 3bfb096 into 3.3 May 8, 2018
@albertomn86 albertomn86 deleted the 3.3-multiregex-plugin branch May 8, 2018 05:44
vikman90 added a commit that referenced this pull request Jun 7, 2018
@vikman90 vikman90 mentioned this pull request Sep 24, 2018
8 tasks
@albertomn86 albertomn86 mentioned this pull request Nov 23, 2018
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants