jbleonesio created page: Elasticsearch authored by Jean-Baptiste Leonesio's avatar Jean-Baptiste Leonesio
...@@ -137,6 +137,31 @@ Any visualisation can be filtered using a request: ...@@ -137,6 +137,31 @@ Any visualisation can be filtered using a request:
![kibana_visualisation3](http://gitlab.srv.picviz/picviz/libpvcop/uploads/3fcb5765cc1e17e095613789b711ba39/kibana_visualisation3.png) ![kibana_visualisation3](http://gitlab.srv.picviz/picviz/libpvcop/uploads/3fcb5765cc1e17e095613789b711ba39/kibana_visualisation3.png)
# Export
```bash
#!/bin/bash
test $# -ne 2 && echo "usage: `basename $0` index output_file" && exit 1
index="$1"
output="$2"
# Get scroll token
scroll_id=`curl --silent -XGET "http://localhost:9200/$index/_search?scroll=1m&search_type=scan" -d '
{
"query": { "match_all": {}},
"size": 10000
}' | jq -r '._scroll_id'`
# Iterate through the whole index
while [[ $scroll_id != null ]] ;
do
ret=`curl --silent -XGET 'http://localhost:9200/_search/scroll?scroll=1m' -d $scroll_id`
echo "$ret" | jq -r '.hits.hits[]._source | del(.message) | to_entries | map([.value]) | [.[] | .[] | tostring] | @csv' >> "$output"
scroll_id=`echo $ret | jq -r '._scroll_id'`
done
```
# Shards # Shards
Shards are [Lucene](https://lucene.apache.org/core/) databases. Shards are [Lucene](https://lucene.apache.org/core/) databases.
... ...
......