デフォルト設定ではクラスタ名が「elasticsearch」となるので、「cluster.name = test_cluster」などのようにクラスタ名称を変更すること
ノード名も「node.name: node_1」などの用に指定すること
curl -XPOST http://localhost:9200/logstash-2015.04.03
curl -XDELETE http://localhost:9200/logstash-2015.04.03
curl -XPUT http://localhost:9200/logstash-2015.04.03 -d '
{
"mappings": {
"squid_log" : {
"properties" : {
"msg12": {
"type" : "long"
}
}
}
}
}'
curl -XGET http://localhost:9200/logstash-2015.04.03/_mapping
curl -XPUT http://localhsot:9200/logstash-2015.04.03/apache_log/1 -d '
{
"host":"localhost",
"verb":"GET"
}
'
curl -XGET http://localhost:9200/logstash-2015.04.03/_search -d '
{
"query": {
"match_all" : {}
}
}
'
curl -XGET http://localhost:9200/logstash-2015.04.03/_search -d '
{
"query": {
"query_string" : {
"query" : "msg12:<100"
}
}
}
'
fluent-plugin-elasticsearch
yum -y install curl-devel
/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-elasticsearch
上記プラグインはfaraday というHTTPクライアントのライブラリを利用しているが、no_proxy環境変数が使えない。http_proxyの設定をしていると自動で使われるので明示的にexport http_proxy=""などする必要がある
type elasticsearch
host localhost
port 9200
type_name squid_log
include_tag_key true
logstash_format true
tag_key tag