I’m trying to parse this JSON object that is being displayed in the message field.
{“version”:“1.1”,“timestamp”:1615840787659,"_GL_timestamp":“2021-03-15T20:39:47.47Z”,"_GL_eventID":null,"_GL_correlation_id":null,"_GL_useragent":“kube-probe/1.18”,"_GL_env":“dev”,"_GL_sourceIP":null,“host”:“DigitalClient”,"_GL_userid":null,"_GL_appid":“Notification”,"_GL_appclass":“com.primerica.dc.notifications.mailapi.config.Profiler$$EnhancerBySpringCGLIB$$a25cd80f”,"_GL_appfunction":“healthCheck”,“level”:6,"_GL_loglevel":null,“short_message”:"",“full_message”:“After execution of healthCheck - Total execution time in milliseconds : 0”,"_GL_latency":0}
I’ve created this pipeline to parse the json, but it is not working. What am I doing wrong?
rule “K8 JSON Parser”
when
has_field(“message”)
then
set_fields(
fields:
key_value(
value: to_string($message.message),
trim_value_chars: “”,
trim_key_chars:"",
delimiters:" “,
kv_delimiters:”:"
)
);
end