Filebeat log format

Hello, I'm using latest beats, but my log format is json,

{"log.level":"info","@timestamp":"2023-04-26T15:59:22.412+0800","log.origin":{"":"instance/beat.go","file.line":779},"message":"Home path: [/Users/evan/go/src/] Config path: [/Users/evan/go/src/] Data path: [/Users/evan/go/src/] Logs path: [/Users/evan/go/src/]","":"filebeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-04-26T15:59:22.413+0800","log.origin":{"":"instance/beat.go","file.line":787},"message":"Beat ID: d246d7f0-3e2b-4eb6-86e9-8090783e5f3a","":"filebeat","ecs.version":"1.6.0"}

how can I get log format like this:


I assume that the format you want to achieve is for your app's log file (as thats the only thing that would make sense). This has nothig to do with filebeat, you have to conffigure logging library/framework that your app uses for logging.

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