Backspace(\b) doesn't work with the gsub filter


(Jvayao) #1

Version: 6.x
Operating System: Any
Backspace(\b) doesn't work with the gsub filter:

Config:

mutate {
	gsub => [
		"Data","\u0000","",
		"Data","\u0001","",
		"Data","\u0002","",
		"Data","\u0003","",
		"Data","\u0004","",
		"Data","\u0005","",
		"Data","\u0006","",
		"Data","\f","",
		"Data","\a","",
		"Data","\b",""
	] 
}
json {
	source => "Data"
}

Log:
[2018-03-13T14:43:55,298][WARN ][logstash.filters.json ] Error parsing json {:source=>"Data", :raw=>"{"bid":"00015","platform":"AndroidPhone","brand":"HUAWEI","device":"ALP-TL00","os":"8.0.0","hid":"23e63ec86d7a48d7NDF7N17C14000402866215033164432","name":"com.android.haitong","ver":"81","token":"","appkey":"BiiilRwAYsKdk828aRMb8ktOXfaTPWAZo1tibfkrkXQ=","sdk_ver":"1.1.19.11","timestamp":"1520913226940"}\b\b\b\b\b\b\b\b", :exception=>#<LogStash::Json::ParserError: Illegal character ((CTRL-CHAR, code 8)): only regular white space (\r, \n, \t) is allowed between tokens at [Source: (byte[])"{"bid":"00015","platform":"AndroidPhone","brand":"HUAWEI","device":"ALP-TL00","os":"8.0.0","hid":"23e63ec86d7a48d7NDF7N17C14000402866215033164432","name":"com.android.haitong","ver":"81","token":"","appkey":"BiiilRwAYsKdk828aRMb8ktOXfaTPWAZo1tibfkrkXQ=","sdk_ver":"1.1.19.11","timestamp":"1520913"; line: 1, column: 306]>}


(Magnus B├Ąck) #2

Here's a list of the supported escape sequences: https://www.elastic.co/guide/en/logstash/current/configuration-file-structure.html


(Christian Dahlqvist) #3

I believe \b matches a word boundary and not backspace.


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.