logstash/docs/plugin-doc.html.erb
2013-08-27 01:14:48 +00:00

91 lines
2.3 KiB
Text

---
title: logstash docs for <%= section %>s/<%= name %>
layout: content_right
---
<h2><%= name %></h2>
<h3>Milestone: <a href="../plugin-milestones"><%= @milestone %></a></h3>
<%= description %>
<% if !@flags.empty? -%>
<!-- Flags are deprecated
<h3> Flags </h3>
This plugin provides the following flags:
<dl>
<% @flags.each do |flag, description| -%>
<%# Prefix flag with plugin name. %>
<dt> <%= flag.gsub(/^--/, "--#{name}-") %> </dt>
<dd> <%= description %> </dd>
<% end -%>
</dl>
... flags are deprecated -->
<% end -%>
<h3> Synopsis </h3>
This is what it might look like in your config file:
<pre><code><% if section == "codec" -%>
# with an input plugin:
# you can also use this codec with an output.
input {
file {
codec =&gt; <%= synopsis.split("\n").map { |l| " #{l}" }.join("\n") %>
}
}
<% else -%>
<%= section %> {
<%= synopsis %>
}
<% end -%></code></pre>
<h3> Details </h3>
<% sorted_attributes.each do |name, config| -%>
<%
if name.is_a?(Regexp)
name = "/" + name.to_s.gsub(/^\(\?-mix:/, "").gsub(/\)$/, "") + "/"
is_regexp = true
else
is_regexp = false
end
-%>
<h4>
<a name="<%= name %>">
<%= name %><%= " (required setting)" if config[:required] %>
<%= " <strong>DEPRECATED</strong>" if config[:deprecated] %>
</a>
</h4>
<ul>
<% if config[:deprecated] -%>
<li> DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version. </li>
<% end -%>
<% if is_regexp -%>
<li> The configuration attribute name here is anything that matches the above regular expression. </li>
<% end -%>
<% if config[:validate].is_a?(Symbol) -%>
<li> Value type is <a href="../configuration#<%= config[:validate] %>"><%= config[:validate] %></a> </li>
<% elsif config[:validate].nil? -%>
<li> Value type is <a href="../configuration#string">string</a> </li>
<% elsif config[:validate].is_a?(Array) -%>
<li> Value can be any of: <%= config[:validate].map(&:inspect).join(", ") %> </li>
<% end -%>
<% if config.include?(:default) -%>
<li> Default value is <%= config[:default].inspect %> </li>
<% else -%>
<li> There is no default value for this setting. </li>
<% end -%>
</ul>
<%= config[:description] %>
<% end -%>
<hr>
This is documentation from <a href="https://github.com/logstash/logstash/blob/v<%= LOGSTASH_VERSION %>/<%= file %>"><%= file %></a>