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":{"file.name":"instance/beat.go","file.line":779},"message":"Home path: [/Users/evan/go/src/github.com/beats/filebeat] Config path: [/Users/evan/go/src/github.com/beats/filebeat] Data path: [/Users/evan/go/src/github.com/beats/filebeat/data] Logs path: [/Users/evan/go/src/github.com/beats/filebeat/logs]","service.name":"filebeat","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-04-26T15:59:22.413+0800","log.origin":{"file.name":"instance/beat.go","file.line":787},"message":"Beat ID: d246d7f0-3e2b-4eb6-86e9-8090783e5f3a","service.name":"filebeat","ecs.version":"1.6.0"}

how can I get log format like this:

Thanks.

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.