Hello.
I have a question about
Generally we use the codec and it works fine. Our application has logs like
{
"profile": "dev",
"logging-context": "default",
"hostname": "xxx",
"app": "xxx",
"@timestamp": "2019-06-05T09:36:30.469+00:00",
"level": "INFO",
"logger_name": "xxx",
"thread_name": "main",
"message": "Logstash is awesome :)"
}
Sometimes in our DEV environment we enable some JVM profiling logs, which are producing plain strings. For example, GC logs or some additional info about JVM attributes to track performance issues.
AS documentation describes:
If this codec recieves a payload from an input that is not valid JSON, then it will fall back to plain text and add a tag
_jsonparsefailure
. Upon a JSON failure, the payload will be stored in themessage
field.
And also it produces a lot of ERROR messages in logstash logs, like
[ERROR] 2019-06-05 11:45:50.347 [[main]<cloudwatch_logs] json - JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: Unrecognized token 'VM': was expecting ('true', 'false' or 'null')
at [Source: (String)"VM settings:"; line: 1, column: 3]>, :data=>"VM settings:"}
So when we are printing some GC info, the logstash log is filled up with with ERROR messages and become too large (>10 GB) that causes our server to stop.
Is it a way to somehow tune the behaviour?
For example, do not print these messages into log file, or somehow skip plain text messages before passing them to json codec