0
Logstash를 사용하여 오류 로그를 구문 분석하여 몇 가지 필드, 특히 errormessage를 캡처하려고합니다. 그러나 Logstash에서 오류 메시지를 캡처 할 수 없습니다. 아래는 내가 쓴 실제 오류 메시지 파서는Logstash Grok Parser가 작동하지 않습니다.
12345 http://google.com 2017-04-17 09:02:43.065 ERROR 10479 --- [http-nio-8052-exec-2] com.utilities.TokenUtils : Error
org.xml.SAXParseException: An invalid XML character (Unicode: 0xe) was found in the value of attribute "ID" and element is "saml".
at org.apache.parsers.DOMParser.parse(Unknown Source)
at org.apache.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
at com.utilities.TokenUtils.validateSignature(TokenUtils.java:99)
파서 :
`%{NOTSPACE:stnum}\s*%{NOTSPACE:requestURL}\s*%{TIMESTAMP_ISO8601:log_timestamp}\s*%{LOGLEVEL:loglevel}\s*%{NUMBER:pid}\s*---\s*\[(?<thread>[A-Za-z0-9-]+)\]\s*%{DATA:class}\s*:\s%{NOTSPACE:level}\s*(?<errormessage>.[^\n]*).[^\n]*`
내가 로그에서이 메시지를 캡처하는 것을 시도하고있다 :
org.xml.SAXParseException: An invalid XML character (Unicode: 0xe) was found in the value of attribute "ID" and element is "saml".
로그 파일과 logstash 필터 파일의 일부를 게시 할 수 있습니까? – Vitorlui