Splunk® SOAR (On-premises)

Administer Splunk SOAR (On-premises)

Acrobat logo Download manual as PDF


Acrobat logo Download topic as PDF

Create custom fields to filter events

Create custom fields that can be added to containers in . You can use custom fields to match your business processes, or to help filter containers, events, or cases for extra attention. For example, you might add a custom field named Department and assign it a list of values for each department in your organization (for example, IT Ops, Sales, and Business).

Custom fields are searchable. For more information on using the search feature, see Search within in Use .

Using custom fields in playbooks requires special coding. Custom field names described here require additional special handling, so plan your naming convention carefully.

  • names containing characters other than letters, numbers, or underscores (_)
  • names starting with a space

Create a custom field

To create a custom field, follow these steps:

  1. From the Home menu select, Administration.
  2. Select Event Settings > Custom Fields.
  3. Click Add Field.
  4. Enter a field name.
  5. Select a field type. If you choose select, provide additional values in the Values field. These values are presented to the user in a drop-down list when working in a container.
  6. (Optional) Select Require on Resolve to make the field required before a container can be closed or resolved.
  7. (Optional) Click Add Field to add additional fields.
  8. Click Save Changes.

Edit custom fields

To edit a custom field, follow these steps:

  1. From the Home menu, select Administration.
  2. Select Event Settings > Custom Fields.
  3. Find the item you want to edit and make your changes. In the Values field for select types, you can enter an additional value or click the X icon to remove existing values.
  4. Check or uncheck Require on Resolve as needed.
  5. Click Save Changes.

Delete a custom field

You can remove a custom field entirely. To remove a custom field, follow these steps:

  1. From the Home menu, select Administration.
  2. Select Event Settings > Custom Fields.
  3. Locate the field you want to remove.
  4. Click the circled x ( ⓧ ) icon at the end of the field's entry.
  5. Click Save Changes.

Update and read custom field values

To update custom field values in containers, use the following code examples with the container.update API :

Update a custom field value

Example code to update a custom field value from a container.

    outputs = {}
    
    # Write your custom code here...
    container = {"id": container_id}
    update = {
        "custom_fields": {
            field_name: field_value,
        },
    }

    # Make the HTTP request
    success, message = phantom.update(container, update)
    
    assert success, message
    
    # Return a JSON-serializable object
    assert json.dumps(outputs)  # Will raise an exception if the :outputs: object is not JSON-serializable
    return outputs


Read a custom field value

While not technically an update function, reading a custom field value also uses the container.update API.

Example code to read (get) a custom field value from a container.

   outputs = {}
    
    # Write your custom code here...
    container = phantom.get_container(container_id)
    custom_fields = container.get("custom_fields", {})
    outputs["field_found"] = field_name in custom_fields
    outputs["field_value"] = custom_fields.get(field_name)
    
    # Return a JSON-serializable object
    assert json.dumps(outputs)  # Will raise an exception if the :outputs: object is not JSON-serializable
    return outputs
Last modified on 15 August, 2022
PREVIOUS
Create custom severity names
  NEXT
Filter indicator records in

This documentation applies to the following versions of Splunk® SOAR (On-premises): 5.3.3, 5.3.4, 5.3.5, 5.4.0


Was this documentation topic helpful?


You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters