Search code examples
jsonelasticsearchcmdconfiglogstash-grok

Logstash - Error Registering Plugin when running config file


Error's i'm getting:

[2018-03-05T09:22:00,976][ERROR][logstash.pipeline] Error registering plugin

[2018-03-05T09:22:01,023][ERROR][logstash.pipeline] Pipeline aborted due to error

[2018-03-05T09:22:01,070][ERROR][logstash.agent] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: LogStash::PipelineAction::Create/pipeline_id:main, action_result: false", :backtrace=>nil}

This is my config file:

input {
    file {
        path => ["C:\logstash-6.2.2\conversation_stats\conversation_stats.json"]
        start_position => "beginning"
        sincedb_path => "/dev/null"
    ignore_older => 0
    }
}
filter{
    grok{
        match =>{ "message"=>"%{DATA:id} %{DATA:clientCode} %{DATA:conversationID} %{DATA:employeeID} %{DATA:entities.entity} %{DATA:entities.location} 
                %{DATA:entities.value} %{DATA:entities.confidence} %{DATA:input} %{DATA:intents} %{DATA:locale}"
        }
        overwrite => ["message"]
    }

}
output{
 stdout { codec => rubydebug }
 file { 
    codec => "json_lines"
    path => ["C:\logstash-6.2.2\Test\testOutput.json"]
 }

 elasticsearch{
        action =>"index"
        hosts => ["localhost:9200"]
        index =>"Converstation_Statistics_%{clientCode}"
 }
}

Here is some sample data:

{
    "_id" : ObjectId("5a2aa415"),
    "clientCode" : "demo",
    "conversationId" : "d6416ec0-da7aa79f3215",
    "employeeId" : "45",
    "entities" : [
        {
            "entity" : "status",
            "location" : [
                NumberInt("09"),
                NumberInt("210")
            ],
            "value" : "ok",
            "confidence" : NumberInt("11")
        }
    ],
    "input" : {
        "feedback" : {
            "feedbackSubject" : "my feedbac",
            "feedbackText" : "feedback\nthis is good\nI love this",
            "feedbackCategory" : "",
            "conversationId" : "d6416ec0-da7aa79f3215",
            "conversationText" : "(HI) [Greetings, human.]",
            "conversationNodeName" : "root"
        }
    },
    "intents" : [
        {
            "intent" : "feedbackresponse",
            "confidence" : NumberInt("1")
        }
    ],
    "locale" : "en-ca"
}

I have a similar json file that works perfectly fine it uploads to elastic without any error's

I have been searching how to solve this for the past couple of days and came up with nothing, help would be greatly appreciated.


Solution

  • Elasticsearch would typically be hosted at port 9200. So the line hosts => ["localhost:5601"] should probably be changed to hosts => ["localhost:9200"] or wherever your ES instance is hosted.