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

Suggestion to allow for conditional ingestor outputs #185

Open
jblackman opened this issue Dec 9, 2020 · 1 comment
Open

Suggestion to allow for conditional ingestor outputs #185

jblackman opened this issue Dec 9, 2020 · 1 comment

Comments

@jblackman
Copy link

Logstash allows us to wrap an output (or input) in a condition block. Could I propose adding a condition: key to the logstash_parser.outputs array? For example:

instance_groups:
- name: ingestor
  jobs:
  - name: ingestor_syslog
    properties:
      logstash_parser:
        outputs:
        - plugin: foo
          options:
            key: "value"
          condition:  '[syslog_program] == "gorouter"'

and this would produce output config like:

outputs {
  if [syslog_program] == "gorouter" {
    foo {
      key => "value"
    }
  }
}

Happy to create a PR for this. I just want to get some feedback if this is an appropriate way to make the change. An alternative would be to create a output_overrides parameter to allow complete customisability, similar to filter_overrides.

@jblackman jblackman changed the title Allow for conditional ingestor outputs Suggestion to allow for conditional ingestor outputs Dec 9, 2020
@jblackman
Copy link
Author

It could also be extended to else blocks with a minor change:

outputs:
- plugin: foo
  options:
    key: "value"
  condition:  'if [syslog_program] == "gorouter"'
- plugin: bar
  options:
    key: "value"
  condition:  'else'

which would produce:

outputs {
  if [syslog_program] == "gorouter" {
    foo {
      key => "value"
    }
  }
  else {
    bar {
      key => "value"
    }
  }
}

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