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

Transport attribut in source #20

Open
nevinet opened this issue Aug 31, 2021 · 3 comments
Open

Transport attribut in source #20

nevinet opened this issue Aug 31, 2021 · 3 comments

Comments

@nevinet
Copy link

nevinet commented Aug 31, 2021

Dear Encore Technologies

First of all thanks a lot for this module.

I found an issue in the source section with the utilitsation of subattribut "transport tls".

Following code create a config error.

Code:

fluentd::config { '001_messageprocessing.conf':
     config => {
       'source' => {
         '@log_level' => 'info',
         '@id'        => "Collector-${location}",
         '@type'      => 'forward',
         'port'       => 24228,
         'transport tls' => {
         #'transport tls' => {
           'cert_path'              => "${sshpath}/fluentd.crt",
           'private_key_path'       => "${sshpath}/fluentd.key",
           'private_key_passphrase' => "${fluent_cert_passphrase}",
         }
     },

Config:

<source>
  @log_level info
  @id Collector-ZG
  @type forward
  port 24228
  <transport tls>
    #version TLSv1_2
    cert_path /etc/ssl/td-agent/fluentd.crt
    private_key_path /etc/ssl/td-agent/fluentd.key
    private_key_passphrase ******
  </transport tls>
</source>

The problem is the end of block. Fluentd require following attribut end: and not </transport tls>
https://docs.fluentd.org/configuration/transport-section

May you already face this problem.

Thanks a lot for the verification and a possible fix

Kind regards

nevinet

@nmaludy
Copy link
Member

nmaludy commented Nov 2, 2021

@nevinet I believe changing your puppet code to the following should work:

fluentd::config { '001_messageprocessing.conf':
     config => {
       'source' => {
         '@log_level' => 'info',
         '@id'        => "Collector-${location}",
         '@type'      => 'forward',
         'port'       => 24228,
         'transport' => {
           'tag_pattern'          => 'tls',
           'cert_path'              => "${sshpath}/fluentd.crt",
           'private_key_path'       => "${sshpath}/fluentd.key",
           'private_key_passphrase' => "${fluent_cert_passphrase}",
         }
     },
}

The 'tag_pattern' property is used to add in the "attribute" in the block header, but not the footer,
The code for this is here: https://github.com/EncoreTechnologies/puppet-fluentd/blob/master/lib/fluent/config.rb#L22-L23

And here: https://github.com/EncoreTechnologies/puppet-fluentd/blob/master/lib/fluent/config.rb#L42-L46

Please let me know if this works for you so i can close this issue.

@nevinet
Copy link
Author

nevinet commented Nov 11, 2021 via email

@nevinet
Copy link
Author

nevinet commented Dec 26, 2021 via email

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

2 participants