Skip to main content
Version: 1.x

Replace

Filter plugin : Replace​

Description​

Replaces field contents based on regular expression.

Options​

nametyperequireddefault value
patternstringyes-
replacementstringyes-
source_fieldstringnoraw_message
target_fieldstringnoreplaced
pattern [string]​

regular expression, such as [a-z0-9], \w, \d

Regular expression used for matching string, such as "[a-zA-Z0-9_-]+".Please see Regex Pattern for details.

You can also go to Regex 101 to test your regex interactively.

replacement [string]​

String replacement.

source_field [string]​

Source field, default is raw_message.

target_field [string]​

New field name, default is replaced.

Examples​

replace {
target_field = "tmp"
source_field = "message"
pattern = "\w+"
replacement = "are"
}

Replace \w+ in message with are and set it to tmp column.