2016-06-02 6 views
0

elasticsearchのreadonly restプラグインに問題があります。プラグインが有効になっているときにlogstashが実行されません。 logstashをfilebeatとともに使用します。これが問題になりますか? logstashの設定は以下の通りです。 エラーメッセージ:elasticsearchでlogstash access with readonly rest plugin

[401] Forbidden {:class=>"Elasticsearch::Transport::Transport::Errors::Unauthorized", :level=>:error} 

あなたは以下を参照してくださいと私たちは役割を定義しています。

readonlyrest: 
    enable: true 
    response_if_req_forbidden: <h1>Forbidden</h1>  
    access_control_rules: 
    - name: Developer (reads only logstash indices, but can create new charts/dashboards) 
     auth_key: dev:dev 
     type: allow 
     kibana_access: ro+ 
     indices: ["<no-index>", ".kibana*", "logstash*", "default"] 
    - name: Kibana Server (we trust this server side component, full access granted via HTTP authentication) 
    auth_key: admin:passwd1 
    type: allow 
    - name: "Logstash can write and create its own indices" 
    auth_key: logstash:logstash 
    type: allow 
    actions: ["cluster:*", "indices:data/read/*","indices:data/write/*","indices:admin/*"] 
    indices: ["logstash*", "filebeat-*", "<no_index>"] 
the logstash config: 

output{ 
    elasticsearch {  
    hosts => ["localhost:9200"] 
     manage_template => true 
     index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}" 
     document_type => "%{[@metadata][type]}" 
     document_id => "%{fingerprint}" 
    user => ["logstash"] 
    password => ["logstash"] 
    } 
} 

答えて

1

私はあなたのセットアップでインデックスを作成する機能をログに記録していないと思います。それは書き込みと読むことができますが、私は作成を見ていません。ウェブサイトの例から

、あなたがあなたのlogstashの設定を変更することができます。このセットアップは私の作品

- name: "Logstash can write and create its own indices" 
    auth_key: logstash:logstash 
    type: allow 
    actions: ["indices:data/read/*","indices:data/write/*","indices:admin/template/*","indices:admin/create"] 
    indices: ["logstash-*", "<no_index>"] 

出力が実際にファイルビートと話していないので、ファイルビートとは関係ないと思いますか?しかし、もう一度、私は代わりにファイル入力を使用しています。

希望が問題を解決します。

アルテール