This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fluent | |
class RedisOutput < Fluent::BufferedOutput | |
Fluent::Plugin.register_output('redis', self) | |
def initialize | |
super | |
require 'redis' | |
require 'msgpack' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fluent | |
class MongoOutput < BufferedOutput | |
Fluent::Plugin.register_output('mongo', self) | |
def initialize | |
super | |
require 'mongo' | |
require 'msgpack' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# install: http://morgangoose.com/blog/2011/01/06/using-the-parallel-branch-of-fabric/ | |
# document: http://docs.fabfile.org/en/1.2.0/index.html | |
# | |
import os | |
from fabric.api import * | |
from fabric.decorators import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my host is host4 | |
<source> | |
type redis_dumper | |
tag reduce_redis | |
host host1 | |
port 6003 | |
delay 10 | |
time_suffix s | |
key key1,key2,key3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# shuffle record partitioned by reduce_key | |
# | |
<match shuffle**> | |
type shuffle | |
reduce_key type | |
<reducer> | |
type shuffle_tcp | |
host delta5 | |
port 24225 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Send massage for servers defined by <forward> tag. | |
## Each input record are shuffled by key and partition function. | |
## Multiple keys are o.k.(sep by ',') and partition function is very flexible. | |
## The shuffle idea is the same as basic MapReduce. | |
<match shuffle**> | |
type shuffle | |
key key1,key2 | |
flush_interval 1s | |
<forward> | |
type shuffle_tcp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'time' | |
... | |
def format(tag, event) | |
record = event.record.dup | |
# if you use a timestamp | |
timestamp = event.time | |
record['timestamp'] = timestamp | |
# if you use a time | |
time_obj = Time.at(event.time) | |
record['time'] = time_obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<match shuffle**> | |
type shuffle | |
key type | |
flush_interval 1 | |
<forward> | |
type shuffle_tcp | |
host delta4 | |
port 24226 | |
</forward> | |
<forward> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/views/*/index.rb.html | |
<% content_for :js do %> | |
$(document).ready(function() { | |
var treeview; | |
var indexes = <%= ActiveSupport::JSON.encode(@indexes).html_safe %>; | |
function onSelect(e) { | |
//alert("Selected: " + indexes[treeview.text(e.node)] ); | |
/* | |
onSelectで要素が選択された時にそれに対するアクションをajaxでなく |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<source> | |
type tail | |
format /^(?<time>[^ ]* [^ ]*[ ]*[^ ]* [^ ]*) \[(?<type>[^\]]*)\] (?<verb>[^ ]*) (?<object>[^ ]*) (?<message>.*)$/ | |
time_format %a %b %e %H:%M:%S | |
path /log/mongo/delta6/shard05/mongo.log,/log/mongo/delta6/shard11/mongo.log,/log/mongo/delta6/shard17/mongo.log,/log/mongo/delta6/shard23/mongo.log | |
tag mongo | |
</source> | |
<match mongo**> | |
type file |
OlderNewer