-
Notifications
You must be signed in to change notification settings - Fork 121
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 new attribute raw_options
to td_agent_source
#123
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
@@ -177,6 +178,21 @@ td_agent_source 'test_in_tail' do | |||
end | |||
``` | |||
|
|||
Use attribute `_raw_options` for attribute that using value such as `Array` or `Hash`. For example when you using [FluentD systemd plugin](https://github.com/reevoo/fluent-plugin-systemd). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, please use fluentd
or Fluentd
, not FluentD
type 'systemd' | ||
tag 'journalctl' | ||
parameters( | ||
matches: [{"_SYSTEMD_UNIT": "syslog.service"}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly speaking, I'm skeptical if this is so useful. If I understand the situation correctly, just passing the parameter as a String
must be sufficient for that purpose.
td_agent_source 'tail_journalctl' do
( ... )
parameters(
matches: ::JSON.generate([{"_SYSTEMD_UNIT": "syslog.service"}])
read_from_head: true
)
end
I know the TdAgent::Helpers.params_to_text
isn't well implemented, but this change would make the situation more complicated with very few actual benefit, I think 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @yyuu thanks for reviewing my PR. I will try your approach and will tell you soon if this works on my case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @yyuu so I've been thinking about your approach. But I found a problem when using this method. How can user set this attributes from nodes.json
files where we can't use ruby code? This will be okay if the user set the attribute directly in attributes
files.
Thanks in advance.
Add capabilities to add an attribute with raw values. This cases will be useful for a plugin like this. The
matches
attribute, need to receive either[]
or{}
value.