Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Similarly, you can also configure Archive Logging in opEvents to archive any specific log entries you require, for any length of time (to learn more about how to configure and activate purging policies, see Purging of old data in opEvents). 

This document describes how you can enable and configure the Archive Logging feature as well as view the archived logs on the opEvents page. 

...

Enabling the Feature

To enable the Archive Loggin Logging feature, open the `opCommon.json` file and set the configuration option `log_archive_enabled` to `true`.

If the option is set to anything but `false`, the script will start archiving log entries.

Configuring the Archive Logs Rules

To configure the Archive Logging feature -

  1. Open the configuration file `EventListRules.json` at `/usr/local/omk/conf/`
  2. Under the `archiveList` block, define the rules with two keys (see the illustration below):
    • archive - the name opEvents uses 
    • regex - a Perl-style regular expression used to match log entries

      Code Block
      languagejs
      title/usr/local/opmojoomk/conf/EventListRules.json
       "archiveList" : {
            "30" : {
               "regex" : "Node (Up|Down)",
               "archive" : "NodeEvents"
            },
            "20" : {
               "archive" : "SoftwareErrorArchive",
               "regex" : "INVMEMINT|MALLOCFAIL"
            },
            "10" : {
               "archive" : "SyslogArchive",
               "regex" : "SYS-[0123]-\\w+"
            }
         }


      Info

      The list of rules is sorted by keys; for instance, rule 10 will run before rule 20.


  3. In the `opCommon.json`, specify the length of time you want to retain the archived logs.  

    Code Block
      "opevents_archivelogs_purge_older_than" : "365d"


  4. Save the files. 


...

To view the archived logs, go to the opEvents page and click Views > Archive Logs.



Related Topics