Logstash unable to gsub a pattern

I am sending below log file from filbeat to Logstash. The below is the output from filbeat to Logstash
This output I got by setting filebeat output to stdout to see what is being sent to Logstash

\u001b[m\u001b[32m[2019-12-02T17:30:09,995] INFO - [http-nio-8080-exec-9:40] {client_ip=13.232.113.45, request_id=8D9383C6E4FD40EC90324627F8EF839C} [filter.RequestAndResponseLoggingFilter.doFilterInternal:113] Response body: {\"status\":\"success\",\"message\":\"success\"}"

I want to remove \u001b[m\u001b[32m

I added below setting in gsub for logstash but it still comes in Kibana ["message","^\\u001b\[m\\u001b\[32m"," "]

I added logstash output to stdout and saw below log as output

\e[m\e[32m[2019-12-03T08:36:16,936] INFO - [http-nio-8080-exec-9:40] {client_ip=x.x.x.x, request_id=DB2126E745454EE88E7090DB403B1864} [filter.RequestAndResponseLoggingFilter.doFilterInternal:90] => [6936] GET

I added multiple gsub still it's not helping

filter{

 mutate {
          gsub => ["message", "\\u001b\[m\\u001b\[32m"," "]
        }
 mutate {
          gsub => ["message", "\\e\[m\\e\[32m"," "]
        }
 mutate {
          gsub => ["message", "\[m\[32m"," "]
        }

}

mutate {
gsub => ["message", ".+?(?=[[0-9]{4}-[0-9]{2}-[0-9]{2})", ""
}

Above GSUB mutate anything before Date. This resolved the issue

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