I’m trying to use stage.template stage to combine multiple fields into output. However whatever i configure template with, nothing works and output is always returned empty. I spent countless hours trying to get the stage working, but fruitlessly. That is very weird because when i leave template out completely, the labels level and output message will get extracted to log lines succesfully.
{"service":"am-booter-invest","environment":"alpha","@timestamp":"2025-04-23T06:02:27.367011582Z","@version":"1.0.0","message":"A message has been sent to AMQP exchange=input-exchange.","logger_name":"c.c.a.c.a.amqp.AmqpClient$Companion","thread_name":"http-nio-8080-exec-7","level":"INFO","req.requestURI":"/run","req.xForwardedFor":"103.202.232.124","request.user_id":"22f955@us-west-1_0vFh","req.method":"POST","req.remoteHost":"14.139.00.00","req.requestURL":"https://alpha-booter-EKS-NLB-3buy998bad2.elb.us-east-1.amazonaws.com/run"}
After implementing stage.template, output is: “” for both of them.
I tested your config and it seems to be working. I omitted the match part because I am not sure what you are matching for.
Test.log:
{"service":"am-booter","environment":"beta","@timestamp":"2025-04-23T06:08:34.57440483Z","@version":"1.0.0","message":"HikariPool-1 - Shutdown initiated...","logger_name":"com.zaxxer.hikari.HikariDataSource","thread_name":"SpringApplicationShutdownHook","level":"INFO"}
{"service":"am-booter-invest","environment":"alpha","@timestamp":"2025-04-23T06:02:27.367011582Z","@version":"1.0.0","message":"A message has been sent to AMQP exchange=input-exchange.","logger_name":"c.c.a.c.a.amqp.AmqpClient$Companion","thread_name":"http-nio-8080-exec-7","level":"INFO","req.requestURI":"/run","req.xForwardedFor":"103.202.232.124","request.user_id":"22f955@us-west-1_0vFh","req.method":"POST","req.remoteHost":"14.139.00.00","req.requestURL":"https://alpha-booter-EKS-NLB-3buy998bad2.elb.us-east-1.amazonaws.com/run"}
Configuration is the pretty much the same as before. Am i the only one, who doesn’t get stage.template to work ? Again, if i leave out the template and set output source to message, it’s working as expected: