How to parse & ingest logs with one json object per line?

Logs question template

I’m forwarding logs to new relic using the agent installed in aws linux 2. The yml configuration file lives in /etc/newrelic-infra/logging.d/print-final.yml and is the following:

  - name: "print-final--production"
    file: /var/log/print-final.log
      logtype: fileRaw

Here is an example from the logs. They’re a common JSON format for golang projects (zerolog, zap, logrus, etc):

{"level":"info","environment":"development","ip":"","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","req_id":"bvhd7ldb4tbemci9a5p0","method":"GET","url":"/","status":200,"size":1867,"duration":0.106931,"time":"2020-12-22T22:21:25-07:00"}
{"level":"info","environment":"development","ip":"","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","referer":"","req_id":"bvhd7ldb4tbemci9a5pg","method":"GET","url":"/css/app.4f9a42b0.css","status":200,"size":145670,"duration":3.50048,"time":"2020-12-22T22:21:25-07:00"}

The instance is showing system level data so the agent is running but the logs aren’t showing up. I click Logs in my dashboard and it takes me to a setup wizard. How do I configure the configuration yml file and set up new relic to parse the json lines from the log?

Hi @sean66, welcome to the Explorers Hub. The best place you can start here is reading through the parsing guidelines for log management here.

Let me know if you need further help.