Enrichment policy creation and management endpoints in the REST API


Create and manage enrichment policies that are used to enrich the logs.

POST/policies
Create an enrichment policy
Request URL
/logs-service/api/v1.0/logs/policies
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/policies
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>


Example request body

{
 "name": "Log Enrichment Policy",
 "description": "Dummy description",
 "selection_criteria": "( Organization Equals 'HP' ) OR ( Host Equals 'bmc_host_name' )",
 "configurations": [
   {
     "name": "CSV_Enrichment",
     "type": "ENRICHMENT",
     "details": {
       "enrichment_type": "CSV",
       "enrichment_source_id": "<ID_value>",
       "enrichment_field_mapping": {
         "$.hostname": "hostname"
       },
       "source_field_mapping": {
         "ipaddress": "$.ipaddress"
       }
     },
     "display_order": 1
   }
  ],
 "enabled": true,
 "execution_order": 1
}


Response codes

Code

Description

201

Enrichment policy is created successfully. Returns the enrichment policy ID in the payload.

400

Error for invalid data. Check if all input values are valid. 

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

415

Incorrect request format. Ensure that the request format is JSON.

500

Unexpected condition encountered. Contact BMC Support.

Back to top

PUT/policies/{id}
Update an enrichment policy by ID
Request URL
/logs-service/api/v1.0/logs/policies/{id}
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/policies/a00a0a00-a000-00a0-a000-0a000aa0a0a0
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>


Parameter details



Example request body

{
 "name": "Log Enrichment Policy",
 "description": "Dummy description",
 "selection_criteria": "( Organization Equals 'HP' ) OR ( Host Equals 'bmc_host_name' )",
 "configurations": [
   {
     "name": "CSV_Enrichment",
     "type": "ENRICHMENT",
     "details": {
       "enrichment_type": "CSV",
       "enrichment_source_id": "<ID_value>",
       "enrichment_field_mapping": {
         "$.hostname": "hostname"
       },
       "source_field_mapping": {
         "ipaddress": "$.ipaddress"
       }
     },
     "display_order": 1
   }
  ],
 "enabled": true,
 "execution_order": 1
}


Response codes

Code

Description

200

Enrichment policy is updated successfully.

400

Error for invalid data. Check if all input values are valid. 

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

404

The enrichment policy ID is not found.

415

Incorrect request format. Ensure that the request format is JSON and enrichment policy IDs are correct.

500

Unexpected condition encountered. Contact BMC Support.

Back to top

GET/policies/{id}
Get an enrichment policy by ID
Request URL
/logs-service/api/v1.0/logs/policies/{ID}
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/policies/a00a0a00-a000-00a0-a000-0a000aa0a0a0
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>


Parameter details



Response codes

Code

Description

200

Enrichment policies returned successfully.

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

404

The enrichment policy ID is not found.

500

Unexpected condition encountered. Contact BMC Support.

Back to top

POST/policies/search
Search enrichment policies
Request URL
/logs-service/api/v1.0/logs/policies/search
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/policies/search
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>


Example request body

{
"page_index": 1,
"page_size": 100,
"search_string": "name = 'Log Enrichment Policy' and enabled = true",
"sort_criteria": "name DESC, enabled ASC"
}


Response codes

Code

Description

200

Enrichment policies are found. Returns details of the policies in the payload.

400

Error for invalid data. Check if all input values are valid. 

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

415

Incorrect request format. Ensure that the request format is JSON and enrichment policy IDs are correct.

500

Unexpected condition encountered. Contact BMC Support.

Back to top

POST/policies/enable
Enable enrichment policies
Request URL
/logs-service/api/v1.0/logs/policies/enable
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/policies/enable
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>


Example request body

{
 "ids": [
   "a00a0a00-a000-00a0-a000-0a000aa0a0a0"
  ]
}


Response codes

Code

Description

200

Enrichment policies are enabled successfully.

207

Some enrichment policies are enabled. IDs of the policies that are not enabled are returned.

400

Error for invalid data. Check if all input values are valid. 

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

415

Incorrect request format. Ensure that the request format is JSON and enrichment policy IDs are correct.

500

Unexpected condition encountered. Contact BMC Support.

Back to top

POST/policies/disable
Disable enrichment policies
Request URL
/logs-service/api/v1.0/logs/policies/disable
Example request URL
https://HostA.bmc.com/logs-service/api/v1.0/logs/policies/disable
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>


Example request body

{
 "ids": [
   "a00a0a00-a000-00a0-a000-0a000aa0a0a0"
  ]
}


Response codes

Code

Description

200

Enrichment policies are disabled successfully. 

207

Some enrichment policies are disabled. IDs of the policies that are not disabled are returned.

400

Error for invalid data. Check if all input values are valid. 

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

415

Incorrect request format. Ensure that the request format is JSON and enrichment policy IDs are correct.

500

Unexpected condition encountered. Contact BMC Support.

Back to top

DELETE/policies
Delete enrichment policies
Request URL
 /logs-service/api/v1.0/logs/policies
Example request URL
 https://HostA.bmc.com/logs-service/api/v1.0/logs/policies
Request Header
Content-Type: application/json
Authorization: Bearer <JWT_token>

For instructions on obtaining the JWT token, see Access and authentication for the REST API..

Example request body

{
 "id": [
   "a00a0a00-a000-00a0-a000-0a000aa0a0a0"
  ]
}

Response codes

Code

Description

200

Enrichment policies are deleted successfully.

207

Some enrichment policies are deleted. IDs of the policies that are not deleted are returned.

400

Error for invalid data. Check if all input values are valid. 

401

Authorization failure. Verify JWT.

403

Permission denied. Verify the roles assigned to you.

415

Incorrect request format. Ensure that the request format is JSON and enrichment policy IDs are correct.

500

Unexpected condition encountered. Contact BMC Support.

Back to top


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Helix Log Analytics 24.3