<!DOCTYPE html>
<html>
<head>
</head>
<body>
<dl style="line-height: 1.5; margin-left: 2em">
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
<dd style="margin-left: 8.5em">Yoji Shidara <dara****@shida*****></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
<dd style="margin-left: 8.5em">2014-02-05 16:51:07 +0900 (Wed, 05 Feb 2014)</dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
<dd style="margin-left: 8.5em"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78">4f72101ec2666605ae67d7ec90b5ce65488e4b78</a></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
<dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">Split into subsections</pre></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
<dd style="margin-left: 8.5em">
<ul>
<li><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#diff-0">tutorial/plugin-development/input-output/index.md</a></li>
</ul>
</dd>
</dl>
<div class="diff-section" style="clear: both">
<table style="border-collapse: collapse; border: 1px solid #aaa">
<thead>
<tr class="diff-header" style="border: 1px solid #aaa">
<td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre"> Modified: tutorial/plugin-development/input-output/index.md (+8 -1)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
</td>
</tr>
</thead>
<tbody>
<tr>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L155">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L156">156</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L157">157</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L158">158</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L159">159</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L160">160</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L161">161</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L162">162</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L185">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L186">186</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L187">187</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L188">188</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L189">189</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L190">190</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L191">191</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L212">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L213">213</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L214">214</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L215">215</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L216">216</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L217">217</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0L218">218</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R155">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R156">156</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R157">157</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R158">158</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R159">159</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R160">160</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R161">161</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R162">162</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R185">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R186">186</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R187">187</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R188">188</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R189">189</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R190">190</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R191">191</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R192">192</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R193">193</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R214">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R215">215</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R216">216</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R217">217</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R218">218</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R219">219</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R220">220</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R221">221</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R222">222</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R223">223</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R224">224</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78#L0R225">225</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -156,7 +156,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">If you have [jq][] installed, you can use `jq` instead of `tr`:</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> jq -c . search-columbus.json | fluent-cat starbucks.message</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-### Do something in the plugin</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+### Do something in the plugin: take logs</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> The plugin we have created do nothing so far. Let's get the plugin to do some interesting.</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -186,6 +186,8 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">And restart fluentd, then send the request same as the previous. You will see so</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> This shows the message is received by our `ExampleInputAdapterPlugin` and then passed to Droonga. Here we can modify the message before the actual data processing.</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+### Modify messages with InputAdapter</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> Suppose that we want to restrict the number of records returned in the response, say `1`. What we need to do is set `limit` to be `1` for every request. Update plugin like below:</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> lib/droonga/plugin/input_adapter/example.rb:</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -213,6 +215,11 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">And restart fluentd. After restart, the response always includes only one record</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> Note that `count` is still `2` because `limit` does not affect `count`. See [search][] for details of `search` command.</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+### Defining original command</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+TODO: write steps to create a new command "starbucks" and accept simple query</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> ## OutputAdapter</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-not-changed" style="display: block; white-space: pre"> In this section, we are going to create an `OutputAdapter`.</span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>