Docs
Search…
Remove
The Remove function accepts and outputs log events, allowing you to remove one or more log fields.

Example

Remove regular field

Suppose we have following log event:
Input
1
{
2
"msg": "remove example",
3
"user_id": "33re3f3",
4
"level": "error"
5
}
Copied!
And we want to remove user_id field, we can fill out function setting like following:
Output event will be following, with user_id field removed
Output
1
{
2
"msg": "remove example",
3
"level": "error"
4
}
Copied!

Remove nested fields

Suppose we have following log event:
Input
1
{
2
"msg": "remove example",
3
"level": "error",
4
"metadata": {
5
"user_id": "wer3e32",
6
"session_id": "wr3r23e13"
7
}
8
}
Copied!
And we want to remove user_id field inside metadata, we can fill out function setting like following:
Output event will be following, with user_id field inside metadata removed
Output
1
{
2
"msg": "remove example",
3
"level": "error",
4
"metadata": {
5
"session_id": "wr3r23e13"
6
}
7
}
Copied!

Remove array value

Suppose we have following log event:
Input
1
{
2
"msg": "remove example",
3
"level": "error",
4
"metadata": ["a", "b", "c"]
5
}
Copied!
And we want to remove "a" inside metadata, we can fill out function setting like following:
Output event will be following, with "a" inside metadata removed
Output
1
{
2
"msg": "remove example",
3
"level": "error",
4
"metadata": ["b", "c"]
5
}
Copied!
You can also remove multiple fields at the same time. To do this, simply concatenate these fields together wit: ,
Last modified 1yr ago