-
Notifications
You must be signed in to change notification settings - Fork 116
Add new attribute raw_options to td_agent_source
#123
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,6 +163,7 @@ Notice: If you use some plugins in your sources, you should install it before yo | |
| | type | Type of source. This is name of input plugin. | | ||
| | tag | Tag, what uses in fluentd routing. | | ||
| | parameters | Parameters of source. Hash. | | ||
| | _raw_options | Use attribute value as is. | | ||
|
|
||
| ### Example | ||
|
|
||
|
|
@@ -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). | ||
| Just add the attribute name as an array item of `_raw_options` | ||
|
|
||
| ```ruby | ||
| td_agent_source 'tail_journalctl' do | ||
| type 'systemd' | ||
| tag 'journalctl' | ||
| parameters( | ||
| matches: [{"_SYSTEMD_UNIT": "syslog.service"}] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 td_agent_source 'tail_journalctl' do
( ... )
parameters(
matches: ::JSON.generate([{"_SYSTEMD_UNIT": "syslog.service"}])
read_from_head: true
)
endI know the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Thanks in advance. |
||
| read_from_head: true | ||
| ) | ||
| _raw_options ["matches"] | ||
| end | ||
| ``` | ||
|
|
||
| ## td_agent_match | ||
|
|
||
| Create file with match definition in `/etc/td-agent/conf.d` directory. It works only if `node[:td_agent][:includes]` is `true` | ||
|
|
||
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
fluentdorFluentd, notFluentD