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

Add defined type for telegraf::processor to define processors #123

Merged
merged 3 commits into from
May 20, 2019
Merged

Add defined type for telegraf::processor to define processors #123

merged 3 commits into from
May 20, 2019

Conversation

philomory
Copy link
Contributor

@philomory philomory commented May 16, 2019

Pull Request (PR) description

This PR simply adds a telegraf::processor defined type which is analogous to the telegraf::input and telegraf::output defined types. You can use it to e.g. define a regex processor:

telegraf::processor { 'regex':
  options => [
    {
      namepass => ['nginx_requests'],
      tags     => [
        {
          key         => 'resp_code',
          pattern     => String(/^(\d)\d\d$/),
          replacement => '${1}xx',
        }
      ],
      fields   => [
        {
          key         => 'request',
          pattern     => String(/^/api(?P<method>/[\w/]+)\S*/),
          replacement => '${method}',
          result_key  => 'method',
        },
        {
          key         => 'request',
          pattern     => String(/.*category=(\w+).*/),
          replacement => '${1}',
          result_key  => 'search_category',
        },
      ],
    },
  ],
}

@dhoppe
Copy link
Member

dhoppe commented May 18, 2019

@philomory Thank you very much for your contribution. Could you please add some tests, update the docs and do the same for aggregators? This would be awesome.

@philomory
Copy link
Contributor Author

@dhoppe I made the requested additions, let me know what you think.

@dhoppe dhoppe merged commit 343bd65 into voxpupuli:master May 20, 2019
@philomory philomory deleted the add_processor_type branch May 21, 2019 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants