Skip to main content

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 Onprem 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

moog_add_alert_custom_field

Adds a new alert custom info field.

moog_add_sitn_custom_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

-d, --display_name <arg>

Name of the field displayed in the UI.

-f, --field <arg>

Custom info field name.

-i, --index

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 --index option to aid filter loading performance.

Too many indexed columns may affect the performance of additions.

-l, --loglevel <arg>

Specify INFO, WARN, or ALL to choose the level of debug output.

-o, --display_only

Indicates the field is for display only and cannot be used to filter, sort or search.

-s, --size <arg>

Index size (the number of characters). This is valid for indexed text fields only. Default is 50.

-t, --type <arg>

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

moog_fill_alert_custom_fields

Fills the filterable alert custom info fields using retrospective data.

moog_fill_sitn_custom_fields

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

-b, --back <arg>

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: -b 2w for two weeks.

-l, --loglevel <arg>

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

moog_remove_alert_custom_field

Removes an alert custom info field.

moog_remove_sitn_custom_field

Removes a Situation custom info field.

You can configure the custom info field you want to remove using the following option:

Option

Description

-f <arg>

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