Custom fields can be configured in opEvents. This article will describe where and how this is possible.
Fields that can be added as a column may be found here: opEvents Normalised Event Properties
In order to enable this feature a directory must be copied into the standard omk config directory.
[root@opmantek ~]# cp -r /usr/local/omk/lib/json/opEvents/table_schemas/ /usr/local/omk/conf/. |
Each view has a separate configuration file that may be found in the following directory:
/usr/local/omk/conf/table_schemas
View | Configuration file |
---|---|
Actions | opEvents_action-log.json |
Raw Logs | opEvents_raw-log.json |
Archive Logs | opEvents_archive-log.json |
Nodes | opEvents_node-log.json |
Summary Reports | opEvents_summary-reports.json |
Edit Nodes | opEvents_node-ip.json |
The configuration files are json files that have a specific syntax that must be observed. Add the desired field to the json file in the order it would appear in. The table will be constructed left to right based on attributed that are read from the top down.
Each field that is added will require a set of attributes. This is an example of the attributes that belong to the 'comment' field.
{ "name": "comment", "label": "Comment", "cell": "string", "search": false, "editable": false } |
Adding and Removing Fields (Columns)
To remove a field simply remove th associated section from the applicable json file. To add a column add a new section in the json file. The column placement will be relative to the order it is put in the json file.
// VERSION=0.4.0 // VERSION=0.4.0 [ [ { { "name": "date", "name": "date", "label": "Date", "label": "Date", "search": false, "search": false, "cell": "string", "cell": "string", "direction": "descending", "direction": "descending", "editable": false "editable": false }, }, { { "name": "event", "name": "eventid", "label": "Event", "label": "Event ID", "cell": "string", "cell": "string", "search": false, "search": false, "editable": false, "editable": false "cell": "LookupUrl", "replace_name": "id", }, "base_url_stash_key": "event_base_url" { }, "name": "event", { "label": "Event", "name": "node", "cell": "string", "label": "Node", "search": false, "search": false, "editable": false, "editable": false, "cell": "LookupUrl", "cell": "LookupUrl", "replace_name": "id", "base_url_stash_key": "node_base_url" "base_url_stash_key": "event_base_url" }, }, { { "name": "action", "name": "node", "label": "Action", "label": "Node", "cell": "string", "search": false, "search": false, "editable": false, "editable": false "cell": "LookupUrl", }, "base_url_stash_key": "node_base_url" { }, "name": "details", { "label": "Details", "name": "action", "cell": "string", "label": "Action", "search": false, "cell": "string", "editable": false "search": false, }, "editable": false { }, "name": "comment", { "label": "Comment", "name": "details", "cell": "string", "label": "Details", "search": false, "cell": "string", "editable": false "search": false, } "editable": false ] } ] |
It is not necessary to restart any daemons. After editing the associated json file simply load (or reload) the view in question.