Unable to Parse New Relic Log Patterns

Viewed 25

The following logs are recorded in the log file SRC-*, whenever a service 'SRC' is restarted, but new-relic unable to parse the pattern which is in the agent.yaml? Am I missing anything here?

Log file:
07:36:21.416 ( 4728: 4728) [Controller] initLogger => SRC Log level is [0x3f]
07:36:21.416 ( 4728: 4728) [Controller] SRC: Starting SRC Controller main..

agent.yaml

logs:
  - name: src monitoring
    file: /cf/data/Logs/SRC-*.Log
    pattern: "[Controller] SRC: Starting SRC Controller main.."
    attributes:
      service: src
2 Answers

First, if you want to use pattern in the yml you would need to simplify the pattern match and remove the special characters. This will work:

logs:

  • name: src monitoring file: /cf/data/Logs/SRC-*.Log pattern: Starting SRC Controller main attributes: service: src

Or you could remove the pattern config and use a drop rule to drop everything where the message isn't like "[Controller] SRC: Starting SRC Controller main.." So run this search: service:src AND message:-"[Controller] SRC: Starting SRC Controller main.." Then Create drop filter, and select Drop logs

Related