0

I'm using elastic search for data and jqxgrid for the display the data. so my requirement is user can also download the grid data using above download button. and it is working fine using jqxgrid functionality. but it only fetch the data from the current records not all because pagination is done by server side so it will export the current page data. My requirement is user can click on download button and the all data exported to csv file.

jqxgrid export functionality is not worked with all pages.

I have checked many solution like . 1. logstash csv export plugin. 2. Is it possible with query that we make a pull request and store the output to csv file.

By default elasticsearch query give the data into json format if i fetch all data and convert into csv is not optimal solution.

input {
 elasticsearch {
    hosts => "localhost:9200"
    index => "magic"
    query => '
    {"query":{"bool":{"must":[{"term":{"product_id":"424509"}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"aggs":{}}
    }
}'
  }
}
output {
  csv {
  fields => ["product_id"]
  path => "/tmp/csv-export55513.csv"
  }
}


curl -o /path/to/file.csv -XGET "localhost:9200/{index}/{type}/_data?format=csv&source={source}"

So is there any straight way to download all data.

truesource
  • 397
  • 3
  • 20

0 Answers0