Не удается запустить logsta sh при включенной безопасности При поиске elasti c и Kibana - PullRequest
0 голосов
/ 06 февраля 2020

Я пытаюсь использовать функцию безопасности в ELK. У меня elasti c версия 7.5.1

У меня проблема с конфигурацией файла. я не могу запустить logsta sh

1. Во-первых, я включаю защиту в elasticsearch.yml, добавив xpack.security.enabled: true

2. Во-вторых, в kibana.yml я редактирую elasticsearch.username = "elascti c" и elasticsearch.password - это мой пароль для установки

Я запускаю службуasticsearch и kibana. все еще здесь все в порядке.

3. Затем я запускаю свой logsta sh с указанным ниже конфигом:

    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}
}

Вот экран, когда я пытаюсь запустить logta sh .service

enter image description here

Спасибо за чтение и надеемся, что вы задали вопрос о моей проблеме.

1 Ответ

0 голосов
/ 12 февраля 2020

ваша конфигурация point 3 должна работать только вам нужно внести одно изменение для создания индекса, обновить вывод:

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