Ошибка при попытке создать индекс в упругом поиске из logstash - PullRequest
0 голосов
/ 07 ноября 2019

Привет, я получаю следующую ошибку при попытке создать индекс в ElasticSearch из logstash:

Агент Converge PipelineAction :: Create - Не удалось выполнить действие {: action => LogStash ::PipelineAction :: Create / pipeline_id: main,: exception => "LogStash :: ConfigurationError",: message => "Ожидается один из #, вход, фильтр, вывод в строке 1, столбце 1 (байт 1)"

Можете ли вы сказать мне, если я что-то не так в моем файле .conf

iput {
    file {
    path => "/opt/sis-host/process/uptime_test*"
#        start_position => "beginning"
        ignore_older => 0
    }
}*emphasized text*

 filter {
     grok {
       match => { "message" => "%{DATA:hora} %{DATA:fecha} %{DATA:status} %{DATA:server} % 
 {INT:segundos}" }
     }
     date {
       match => ["horayfecha", "HH:mm:ss MM/dd/YYYY" ]
       target => "@timestamp"
     }
 }

 output {
       elasticsearch {
           hosts => ["host:9200"]
           index => "uptime_test-%{+YYYY.MM.dd}"
       }
       stdout { codec => rubydebug }
}

1 Ответ

0 голосов
/ 07 ноября 2019

Файл конфигурации должен начинаться с ввода, а не с «iput»

input {  # not iput
    file {
    path => "/opt/sis-host/process/uptime_test*"
#        start_position => "beginning"
        ignore_older => 0
    }
}

 filter {
     grok {
       match => { "message" => "%{DATA:hora} %{DATA:fecha} %{DATA:status} %{DATA:server} % 
 {INT:segundos}" }
     }
     date {
       match => ["horayfecha", "HH:mm:ss MM/dd/YYYY" ]
       target => "@timestamp"
     }
 }

 output {
       elasticsearch {
           hosts => ["host:9200"]
           index => "uptime_test-%{+YYYY.MM.dd}"
       }
       stdout { codec => rubydebug }
}
...