Display Additional Data in Custom Info Fields
Custom info fields are customizable fields relating to either an alert or a Situation that can be added to Moogsoft Enterprise during configuration. Custom info fields hold data in addition to the core event fields for events and alerts. See Alert and Event Field Reference.
These fields are displayed in the UI as columns in the Alert and Situation Views and can be configured with optional sorting and filtering.
Custom info commands can be found in the usr/share/moogsoft/bin/utils
folder.
Add custom info fields
You can use the following commands to add either alert or Situation custom info fields:
Command | Description |
---|---|
| Adds a new alert custom info field. |
| Adds a new Situation custom info field. |
You can use the following options to configure the display name, the field name and indexing:
Option | Description |
---|---|
| Name of the field displayed in the UI. |
| Custom info field name. |
| Indicates the field is indexed for filtering and sorting. This option cannot be used with display only fields. If you are planning to use this custom info field in alert or Situation filters ,or you are planning to sort using this column weMoogsoft recommends that you use the Too many indexed columns may affect the performance of additions. |
| Specify INFO, WARN, or ALL to choose the level of debug output. |
| Indicates the field is for display only and cannot be used to filter, sort or search. |
| Index size (the number of characters). This is valid for indexed text fields only. Default is 50. |
| Type of field (number or text). Default is number. |
Example
Example to add an alert custom info text field which is also indexed so that you can sort or filter on it:
[root@moogsoft ~]# moog_add_alert_custom_field -d newfield -f new_field -i -t TEXT
Successfully adding the new custom info field is confirmed with a message similar to the following:
Field newfield was added to UI successfully Filterable field custom_info.new_field was added successfully
Fill custom info fields
There is a utility that enables you to fill the alerts or Situations filterable custom info fields using retrospective data:
Command | Description |
---|---|
| Fills the filterable alert custom info fields using retrospective data. |
| Fills the filterable Situation custom info fields using retrospective data. |
You can configure the amount of time the fill utility goes back and the log level using the following options:
Option | Description |
---|---|
| Defines how far back the fill utility goes, with 's' for seconds, 'm' for minutes, 'h' for hours, 'd' for days and 'w' for weeks. You can leave empty for all but this might take some time. For example: |
| Specify INFO, WARN, or ALL to choose the level of debug output. |
Example
Example to fill Situation custom info fields with retrospective data from the past three days:
[root@centos7 ~]# moog_fill_sitn_custom_fields -b 3d Filterable custom info data was filled successfully
Remove custom info fields
You can use the following commands to remove previously configured alert or Situation custom info fields:
Command | Description |
---|---|
| Removes an alert custom info field. |
| Removes a Situation custom info field. |
You can configure the custom info field you want to remove using the following option:
Option | Description |
---|---|
| Defines the custom info field name to select the field you want to remove. |
Example
Example to remove a custom info field called 'new_field'.
[root@moogsoft ~]# moog_remove_alert_custom_field -f new_field Field custom_info.new_field was removed successfully
Configure custom info search
You must run a utility if custom info columns are added and existing alerts or Situations contain values in that column for them to be filterable in the UI. Alerts or Situations which are new or updated after the new column has been added will be filterable automatically.
If you added an alert custom info field, run $MOOGSOFT_HOME/bin/utils/moog_fill_alert_custom_fields
.
If you added a Situation custom info field, run $MOOGSOFT_HOME/bin/utils/moog_fill_sitn_custom_fields
.