[英]logstash access with readonly rest plugin
我们对 elasticsearch 的 readonly rest 插件有一个问题:启用插件后,我们没有运行 logstash。 我们将 logstash 与 filebeat 一起使用。 这可能是问题吗? logstash 配置如下。 错误信息:
[401] Forbidden {:class=>"Elasticsearch::Transport::Transport::Errors::Unauthorized", :level=>:error}
在 elasticsearch 中,我们定义了如下所示的角色。
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"]
}
}
我相信您没有赋予 logstash 使用您的设置创建索引的能力。 它可以读写,但我没有看到创建。
从网站的示例中,您可以将您的 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>"]
这个设置对我有用。
我认为它与 filebeat 没有任何关系,因为输出实际上不再与 filebeat 对话了? 但话又说回来,我改用文件输入。
希望能解决问题。
阿图尔
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.