给Elasticsearch 5.2.2 设置用户权限 how to setting security for elasticsearch on windows

1. download the plugin of elasticsearch: 

下载 readonlyrest-1.14.0_es5.2.2.zip

 

2. install readonlyrest plugin: 

C:\Users\Administrator\Downloads\elasticsearch-5.2.2\bin\elasticsearch-plugin.bat install file:///d:/readonlyrest-1.14.0_es5.2.2.zip

 

3. open elasticsearch.yml add blow code:

1
2
3
4
5
6
7
readonlyrest:
    enable: true
    response_if_req_forbidden: Sorry, your request is forbidden.
    access_control_rules:
    - name: Full access with HTTP auth
      auth_key: admin:123456  #user: admin, password:123456
      type: allow

 

4. restart elasticsearch service.

5. done;

 

 

logstash配置:

复制代码
input {  
      file {
          path => "D:/logstash-5.2.2/bin/testdata.txt"
          start_position => "beginning"
          sincedb_path => "D:/logstash-5.2.2/bin/sincedb"
          codec => json {
            charset => "UTF-8"
        }       
      }
}
filter {  
   json{
   source => "message"
   }

   
    mutate
    {
        remove_field => [ "message","path","@version","@timestamp","host","_id","value"]
    }
}
output {  
    elasticsearch {
        action => "index"
        hosts => ["http://localhost:9100/"] 
        user => "admin"
        password => "123456"
     
        index => "testdb"
        document_type => "user"
        workers => 1
    }
     #stdout {
         #codec => rubydebug
         #codec => json_lines
     #}
} 
复制代码

 

posted @   iDEAAM  阅读(2023)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
历史上的今天:
2015-03-13 Microsoft Dynamics CRM 数据库连接存储位置在哪里 是在注册表里
2009-03-13 技巧/诀窍:在ASP.NET中重写URL
2009-03-13 制造型企业ERP项目需求分析
点击右上角即可分享
微信分享提示