How to sort the data in Logstash?

I have ingested the data from CSV into Elasticsearch, however, when I view them in 'Discover, Kibana' the ID did not ingest in order.

The field 'ID' in the CSV doc starts from 1

For example, instead of:
1
2
3
4

It was ingested like this:
4
2
1
3

Here is my logstash.conf

 filter {
   csv {
    separator => ","
    columns => ["ID","Title","Grant ($)"]
}

Is there any way I can sort this out (no pun intended)?

Not in Logstash.

Did you sort by the ID field in Kibana?

Hi @warkolm! My ID is in strings. I am not sure how to do the sort in Kibana though.

Any help?

Is it something like this

POST/my_index/
{
    "sort" : [
        { "ID" : {"order" : "asc"}}

If you click on the column header you can sort.

I believe I have to convert the ID to integer to make this work?

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