Skip to content

Instantly share code, notes, and snippets.

@andrewvc
Last active Mar 1, 2021
Embed
What would you like to do?
# WARNING: This will delete all heartbeat network info and screenshot docs older than 7 days ago at midnight
# For large datasets its a good idea to set wait_for_completion to false since the request
# may block for a while
POST heartbeat-*/_delete_by_query?wait_for_completion=false
{
"query": {
"bool": {
"filter": [
{
"range": {
"@timestamp": {
"lt": "now-7d/d"
}
}
},
{
"bool": {
"should": [
{
"match": {
"synthetics.type": "step/screenshot"
}
},
{
"match": {
"synthetics.type": "journey/network_info"
}
}
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment