elasticsearch

Elasticsearchをインストールする。

まず、javaが必要なのでインストールする。

# yum -y install java-1.7.0-openjdk

 
Elasticsearchをインストールする

# wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.4.noarch.rpm 

# rpm -ivh elasticsearch-1.2.0.noarch.rpm
 
起動させる

service elasticsearch start

 
 
fluent-plugin-elasticsearchをインストール
まず、gcc libcurl-devel をインストール

yum -y install gcc libcurl-devel 
 
fluent-plugin-elasticsearchをインストールする際に必要。
 
fluent-plugin-elasticsearchをインストールする。

/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-elasticsearch

 
td-agent.confを書き換え、
ApacheのログをElasticsearchに記録するよう設定する。
 
検索コマンド
curl -XGET ‘http://localhost:9200/logstash-2014.10.01/ny_acl_log/_search?query=process:nserver

全データを削除
# curl -XDELETE ‘http://localhost:9200/*’ {“acknowledged”:true}