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
# fluentd 0.10.35 | |
# elasticsearch 0.90.1 | |
# kibana 0.2.0 | |
# fluentd.conf | |
<match java_service.accesslog> | |
type elasticsearch | |
host localhost | |
port 9200 | |
index_name java_service # ignore? |
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
################################################################################ | |
# ※追記 | |
################################################################################ | |
in_tail -> out_forward -> in_forward -> out_file | |
の動作確認をしたかったが、2パターンとも期待とは異なっていたことが判明。 | |
NGとしていたパターンは常に <match forward.p.**> にマッチし、 | |
in_tail -> out_forward -> in_forward -> out_forward -> in_forward -> ... とループする。 | |
OKとしていたパターンは常に <match forward.p.java-pd.access> にマッチし、 |
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 'date' | |
require 'time' | |
require 'json' | |
require 'fluent-logger' | |
logger = Fluent::Logger::FluentLogger.new(nil, :host => '127.0.0.1', :port => 24224) | |
IO.foreach("fluentd_out_file.log") { |line| | |
line.scan(/^([^\t]+)\t([^\t]+)\t(.+)$/) { |a| | |
datetime = DateTime.parse(a[0]) | |
time = datetime.to_time |
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
File.expand_path(File.dirname(__FILE__)) | |
= | |
File.expand_path('.', File.dirname(__FILE__)) | |
= | |
File.expand_path('..', __FILE__) | |
File.dirname(File.expand_path(__FILE__)) |
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 ActiveModel | |
# == Active \Model ByteLength \Validator | |
module Validations | |
class ByteLengthValidator < EachValidator # :nodoc: | |
MESSAGES = { is: :wrong_length, minimum: :too_short, maximum: :too_long, encoding: "encode_error" }.freeze | |
CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze | |
RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :too_short, :too_long] |
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
Lucene, Solr, ElasticSearchの基本は転置インデックス | |
転置インデックスの作り方 | |
・N-gram | |
・形態素解析 | |
フィールドごとに使い分けをする | |
ElasticSearchのインデックス構成(論理) |
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
var toTraversable = function(args) { | |
var $result = $(); | |
$(arguments).each(function() { | |
var $this = $(this); | |
if ($this.length > 1) { | |
$this.each(function() { | |
$.merge($result, toTraversable(this)); | |
}); | |
} else { | |
$.merge($result, $this); |
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
# mingw(32bit) に the silver searcher 0.18.1 をインストールしたときのメモ | |
# mingw は C:\MinGW へインストールし、一通りのパッケージも合わせてインストールした。 | |
# pkgconfig をビルド | |
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz | |
tar xzf pkg-config-0.28.tar.gz | |
cd pkg-config-0.28 | |
./configure --with-internal-glib | |
make | |
make install |
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
・実行コマンド | |
curl -XPUT 'http://127.0.0.1:9200/_snapshot/my_backup' -d '{ | |
"type": "fs", | |
"settings": { | |
"location": "/tmp/my_backup" | |
} | |
}' | |
curl -XPUT 'http://127.0.0.1:9200/_snapshot/my_backup/snapshot_1?wait_for_completion=true' | |
curl -XPUT 'http://127.0.0.1:9200/_snapshot/my_backup/snapshot_2?wait_for_completion=true' |
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
2013-12-09 14:49:10 +0900 [info]: shutting down fluentd | |
2013-12-09 14:49:10 +0900 [warn]: unexpected error while shutting down error_class=NoMethodError error=#<NoMethodError: undefined method `close' for nil:NilClass> | |
2013-12-09 14:49:10 +0900 [warn]: /usr/local/lib/ruby/gems/2.0.0/gems/fluentd-0.10.41/lib/fluent/plugin/in_tail.rb:146:in `block in close' | |
2013-12-09 14:49:10 +0900 [warn]: /usr/local/lib/ruby/gems/2.0.0/gems/fluentd-0.10.41/lib/fluent/plugin/in_tail.rb:145:in `reject!' | |
2013-12-09 14:49:10 +0900 [warn]: /usr/local/lib/ruby/gems/2.0.0/gems/fluentd-0.10.41/lib/fluent/plugin/in_tail.rb:145:in `close' | |
2013-12-09 14:49:10 +0900 [warn]: /usr/local/lib/ruby/gems/2.0.0/gems/fluentd-0.10.41/lib/fluent/plugin/in_tail.rb:75:in `block in shutdown' | |
2013-12-09 14:49:10 +0900 [warn]: /usr/local/lib/ruby/gems/2.0.0/gems/fluentd-0.10.41/lib/fluent/plugin/in_tail.rb:74:in `each' | |
2013-12-09 14:49:10 +0900 [warn]: /usr/local/lib/ruby/gems/2.0.0/gems/fluentd-0.10.41/lib/fluent/plugin/in_tail.rb:74:in `s |
OlderNewer