With Atatus Log Monitoring, you can monitor specific log files.

Setup & Configuration

This module is included with the Atatus Infra agent by default, please follow the below steps to enable.

  1. Add the following lines in the file /etc/atatus-infra-agent/atatus.yml.

    copy
    icon/buttons/copy
    logs_enabled: true
    
  2. Copy the files example configuration file.

    copy
    icon/buttons/copy
    cd /etc/atatus-infra-agent/conf.d/files.d/
    sudo cp files.yml.template files.yml
    
  3. Update the file /etc/atatus-infra-agent/conf.d/files.d/files.yml with below configurations.

    copy
    icon/buttons/copy
    #Log section
    logs:
    
      # - type: (mandatory) type of log input source (file)
      #   paths: (mandatory) Set paths if type is file
      #   service: (mandatory) name of the service owning the log
      #   source: (mandatory) attribute that defines which integration is sending the log
      #   severity: (optional) status type of the log (info / error / warn). Default info
    
      - type: file
        paths:
          - /path/to/your/custom/info-file.log
        service: my_service
        source: my_source
        # Processing rules are the way to group multiple consecutive messages into single one.
        # Below processing rule will group messages which has one or many spaces at the beginning of a message.
        processing_rules:
          - type: 'multiline'
            pattern: '^[[:space:]]'
            negate: false
            group: 'after'
    
      - type: file
        paths:
          - /path/to/your/custom/error-file.log
        service: my_service1
        source: my_source1
        severity: error
        processing_rules:
          - type: 'multiline'
            pattern: '^[[:space:]]'
            negate: false
            group: 'after'
    
  4. Restart the atatus infrastructure agent.

    copy
    icon/buttons/copy
    sudo service atatus-infra-agent restart