Navigation Menu

Skip to content

Commit

Permalink
Split into subsections
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Feb 5, 2014
1 parent e29962c commit 4f72101
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tutorial/plugin-development/input-output/index.md
Expand Up @@ -156,7 +156,7 @@ If you have [jq][] installed, you can use `jq` instead of `tr`:

jq -c . search-columbus.json | fluent-cat starbucks.message

### Do something in the plugin
### Do something in the plugin: take logs

The plugin we have created do nothing so far. Let's get the plugin to do some interesting.

Expand Down Expand Up @@ -186,6 +186,8 @@ And restart fluentd, then send the request same as the previous. You will see so

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.

### Modify messages with InputAdapter

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:

lib/droonga/plugin/input_adapter/example.rb:
Expand Down Expand Up @@ -213,6 +215,11 @@ And restart fluentd. After restart, the response always includes only one record

Note that `count` is still `2` because `limit` does not affect `count`. See [search][] for details of `search` command.

### Defining original command

TODO: write steps to create a new command "starbucks" and accept simple query


## OutputAdapter

In this section, we are going to create an `OutputAdapter`.
Expand Down

0 comments on commit 4f72101

Please sign in to comment.