Voor het updaten van settings in meerdere indexen.
curl -XPUT 10.20.40.1:9200/packetbeat-*/_settings -H 'Content-Type: application/json' -d'
{ "index": {
"lifecycle": {
"name": "Purge-Packetbeat"
}
}
}'
Uitzetten shard relocation voor upgrade node.
curl -XPUT "10.20.40.2:9200/_cluster/settings" -H 'Content-Type: application/json' -d '{
"transient" : {
"cluster.routing.allocation.enable" : "primaries"
}
}'
Aanzetten shard relocation na de upgrade van een node.
curl -XPUT "10.20.40.2:9200/_cluster/settings" -H 'Content-Type: application/json' -d '{
"transient" : {
"cluster.routing.allocation.enable" : null
}
}'
Uploaden nieuwe index template
curl -XPUT "10.20.40.1:9200/_template/elastiflow-3.4.1" -H 'Content-Type: application/json' -d '{
"index_patterns": ["te*", "bar*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"_source": {
"enabled": false
},
"properties": {
"host_name": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "EEE MMM dd HH:mm:ss Z yyyy"
}
}
}
}'
Of na -d @bestandsnaamtemplate invoeren.
Verwijderen van documenten op basis van query. (In dit geval veld media_type = CHAT
curl -XPUT "10.20.40.1:9200/infomart-int-*/_delete_by_query" -H 'Content-Type: application/json' -d '{
"query": {
"match": {
"media_type": "CHAT"
}
}
}'