0

No matter what i change it feels like the gsub is just ignored.

"port": 5021,
"@timestamp": "2020-07-25T02:16:03.747Z",
"host": "xxx.xxx.xxx.xxx",
"@version": "1",
"message": "000 361.609\r"

This is my output, ultimately i want to remove everything after the backlash (backlash included) from the message field. Right now i'm just trying to target the r and even that doesn't work so i need help figuring out what's wrong.

filter {
  mutate{ 
    gsub => [
    "message", "[r]", ""]
  }
}

1 Answers1

0

The /r is read directly as a spacing character so a white space and not as the text "/r" so by going with

filter {
  mutate{ 
    gsub => [
    "message", "[\s+]", ""]
  }
}

the problem is solved !