Skip to content

Instantly share code, notes, and snippets.

@dhavaln
Created September 5, 2022 05:07
Show Gist options
  • Save dhavaln/cd1ec6b7fa8f9ade45e98df541cb62c4 to your computer and use it in GitHub Desktop.
Save dhavaln/cd1ec6b7fa8f9ade45e98df541cb62c4 to your computer and use it in GitHub Desktop.
Delete Records from Elastic Index
curl -k -X POST "https://<URL>/<index>/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"bool": {
"filter": [
{
"range": {
"@timestamp": {
"lt": "now-180d"
}
}
}
]
}
}
}
@dhavaln
Copy link
Author

dhavaln commented Sep 5, 2022

Remove 6 month old records from the ES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment