remove
Description
The remove command deletes one or more keypaths from every document in the
working set. It is the inverse of choose, which keeps only the specified
fields.
This is especially useful for sanitizing logs or removing fields containing unnecessary or sensitive information before performing analysis.
note
remove can operate on scalar values or entire objects.
Syntax
'r|remove <keypath1> [ "," <keypath2> ]...'
Example
Use case: Remove personal data from logs
Suppose your dataset includes user information, and you need to remove the
email field for privacy reasons before further processing.
Example data
{
"username": "chris",
"email": "chris@coralogix.com",
"location": "UK",
"domain": "chris.com"
}
Example query
remove email
Example output
{
"username": "chris",
"location": "UK",
"domain": "chris.com"
}
The remove command eliminates the email keypath and its value from each
document, leaving all other fields intact.