How can I run this KQL in the bash command
POST _all/_delete_by_query
{
"query": {
"range": {
"@timestamp": {
"lte": "now-5d"
}
}
}
}
Thank you in advance!
How can I run this KQL in the bash command
POST _all/_delete_by_query
{
"query": {
"range": {
"@timestamp": {
"lte": "now-5d"
}
}
}
}
Thank you in advance!
curl --user name:password -X POST "localhost:9200/my-index-000001/_delete_by_query?conflicts=proceed&pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"range": {
"@timestamp": {
"lte": "now-5d"
}
}
}
}
Replace with the appropriate authentication and your hostname.
How about in a shell script?
We don't provide official guidance for shell scripting, so this is something for you to play around with.
Hello, this works for me.
curl -XPOST "YourLocalhost:9200/YourIndexName/_delete_by_query" -H 'Content-Type: application/json' -d' { "query": { "range": { "@timestamp": { "lte": "now-5d" } } } }' -u YourElasticUsername:AndPassword
I added my Elastic Username and Password to the last of the command.
Thank you!
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.