Created
September 5, 2022 05:07
-
-
Save dhavaln/cd1ec6b7fa8f9ade45e98df541cb62c4 to your computer and use it in GitHub Desktop.
Delete Records from Elastic Index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove 6 month old records from the ES