【问题标题】:Can't not start logstash when enable security At elastic search and Kibana在弹性搜索和 Kibana 中启用安全性时无法启动 logstash
【发布时间】:2020-02-06 03:52:57
【问题描述】:

我正在尝试使用 ELK 的安全功能。我的弹性版本是 7.5.1

我的文件配置有问题。我无法启动logstash

1.首先,我通过添加xpack.security.enabled: trueelasticsearch.yml中启用安全性

2.其次,在kibana.yml 我编辑elasticsearch.username = "elastic" 和elasticsearch.password 是我的设置密码

我启动服务 elasticsearch 和 kibana。 还在这里,一切都很好。

3.然后我使用下面的 conf 运行我的 logstash:

    input {
        file {
                path => ["/etc/logstash/handleexception1.txt"]
        type => "_doc"
                start_position => beginning
        }
}
filter {
        dissect {
            mapping => {
                "message" => "%{Date} %{Time} %{INFO} %{Service} Message:%{Message} ExceptionList:%{ExceptionList}"
            }
        }
}
output {
                hosts => ["localhost:9200"]
        index => "logstashhhandlerror2"
        user => "elastic"
        pasword => "elastic"
        }
        stdout { codec => rubydebug}
}

其实我都试过了

input {
elasticsearch{
    file {
            path => ["/etc/logstash/handleexception1.txt"]
    type => "_doc"
            start_position => beginning
    }
user => "elastic"
password => "elastic"
}
}

filter {
    elasticsearch{
        dissect {
            mapping => {
                "message" => "%{Date} %{Time} %{INFO} %{Service} Message:%{Message} ExceptionList:%{ExceptionList}"
            }
        }
    user => "elastic"
    password => "elastic"
    }
}
output {
                hosts => ["localhost:9200"]
        index => "logstashhhandlerror2"
        user => "elastic"
        pasword => "elastic"
        }
        stdout { codec => rubydebug}
}

这是我尝试启动 logtash.service 时的屏幕

感谢您的阅读,希望您能解决我的问题。

【问题讨论】:

  • 实际我开始但无法创建任何索引 :( 这就是问题所在

标签: elasticsearch logstash logstash-configuration elk logstash-file


【解决方案1】:

您的第 3 点配置应该可以正常工作,您只需对索引创建进行一项更改,更新输出:

output {
    elasticsearch {
      hosts => ["localhost:9200"]
      index => "logstashhhandlerror2"
      user => "elastic"
      pasword => "elastic"
    }
    stdout { codec => rubydebug}
  }
 }

【讨论】:

    猜你喜欢
    • 2015-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-10
    • 1970-01-01
    • 2018-08-10
    相关资源
    最近更新 更多