File output not ordered with -w 1


#1

Hello, I have a logstash configuration

input{
elasticsearch {
        hosts=> [ "SERVERHOST"]
        index => "logstash-syslog-2016.12.01"
         query => '{"filter" : {
                    "term" : { "host.raw" : "HOST" }

        }}'
    }

}

output {
   file{
         path => "/etc/elk/logout/FILE.log"
        }


}

The problem I have is with the file output, it is not ordered, I decreased the amount of workers to 1, but even with this the data appears not ordered in the file. (in ES is ordered)


(Mark Walkom) #2

You need to add a sort section to the query - https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-sort.html


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.