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

Index conditional match in output elasticsearch #97

Merged
merged 2 commits into from
Mar 28, 2017
Merged

Index conditional match in output elasticsearch #97

merged 2 commits into from
Mar 28, 2017

Conversation

cristianocasella
Copy link
Contributor

Adding a conditional statement to switch the output to different index and/or pipeline basing on a specific filter.
Refer to issue #96

Adding a conditional statement to switch the output to different index and/or pipeline basing on a specific filter.
@cristianocasella
Copy link
Contributor Author

manifest sample:

  class { 'filebeat':
    major_version => '5',
    outputs       => {
      'elasticsearch' => {
        'hosts'    => [
          'http://elasticsearch.domain.ext:9200'
        ],
        'index'    => 'docker-log-%{+yyyy.MM.dd}',
        'pipeline' => 'docker-log',
        'indices'  => [
          'indice' => {
            'name'     => 'docker-warning-%{+yyyy.MM.dd}',
            'filter'   => 'message',
            'pattern'  => 'WARNING',
            'pipeline' => 'docker-warning'
          },
          'indice' => {
            'name'     => 'docker-critical-%{+yyyy.MM.dd}',
            'filter'   => 'message',
            'pattern'  => 'CRITICAL',
            'pipeline' => 'docker-critical'
          },
        ]
      }
    }
  }

This commit allow to not specify any indices
@pcfens
Copy link
Owner

pcfens commented Mar 28, 2017

Thanks for this. Don't worry about the failing tests, it looks like I have some work to do on the Rakefile and Gemfile. I'll merge when I get to a real computer later this morning.

@cristianocasella
Copy link
Contributor Author

thanks,
let me know if I have to put the sample/documentation in the readme or your prefere to do it yourself

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 this pull request may close these issues.

2 participants