Extracting fields
A lot of useful information is available inside the log message. You can extract this information as fields.
The extracted fields are available on the Explorer > Discover page in the Available fields section.
Use the fields that you extract from a log message for the following purposes:
- To analyze logs for a particular field value.
- To create visualizations in the Explorer tab and BMC Helix Dashboards.
- To use these fields in other capabilities such as enrichment and alerts.
The following video (1:19) provides a brief overview of the field extraction feature.
To extract fields
- Click the Configurations menu and select Field Extraction.
- On the Field Extraction Policies page, click Create.
- Enter a unique name such as ApplicationLogsFieldExtraction, and an optional description.
In the Precedence field, set a precedence number for the policy. This precedence number defines the priority for executing the policy.
Note that a policy with a lower precedence number is executed first.
If the incoming logs satisfy the selection criteria of multiple field extraction policies, the value in this field determines the execution order of the policies. The changes defined in the last field extraction policy that is applied to the incoming logs are saved.- In the Policy Selection Criteria field, configure the condition to identify the logs from which the fields should be extracted.
For example, kubernetes.container_name Equals log-processing-service. - In the Field Extraction Configuration section, from the Log Field list, select the field from which fields should be extracted.
For example, message. - Copy the value of the field that you have selected in Log Field and paste it in the Log Field Value field.
In the Regular Expression field, enter the name group regular expression for Java to read and interpret the log entry that you have pasted in the Log Field Value field.
- Click Extract.
The fields that can be extracted are displayed in the Extracted Fields table and the Select Fields to Extract field. - (Optional) To remove a field from extraction, in the Select Fields to Extract field, remove the field.
- Select Enable Policy.
- Save the policy.
View all your policies on the Field Extraction Policies page. To edit, enable, disable, or delete a policy, use the Actions menu.
Related topic
Field-extraction-policy-creation-and-management-endpoints-in-the-REST-API