Custom Named Entities

Learn how to work with custom named entities.

In order to use custom named entities during processing, first identify how your userDataDirectories are configured in the application.properties file.

Creating a Custom Named Entity

Create the following Custom Named Entity file with the following content. Save the file to the ${NUIX_ENGINE_HOME}/user-data-extra/Named Entities directory as df277620-c457-467b-98c7-86d074128ffd.cne. You can generate any UUID for this filename and the uuid field name in the content.

{
"name": "MyCNE",
"description": "Starts With T",
"regex": "T*",
"uuid": "df277620-c457-467b-98c7-86d074128ffd"
}

Create the Named Entity Profile

Next, create the following Named Entity Profile with the following content. Save the file to ${NUIX_ENGINE_HOME}/user-data-extra/Named Entity Profiles directory as MyNamedEntityProfile.nep. Notice how the named entity profile is referencing the previously created custom named entity.

{
  "version": 1,
  "description": "Starts With T",
  "namedEntities": [
    "df277620-c457-467b-98c7-86d074128ffd"
  ]
}

Create the Processing Profile

Next, we have to add the Named Entity Profile to a Processing Profile that we will use. For the sake of this example we will just make a copy of the Default.xml profile and add the following line to the data-processing-settings section.

<named-entity-profile-name>MyNamedEntityProfile</named-entity-profile-name>

Save the file to ${NUIX_ENGINE_HOME}/user-data-extra/Processing Profiles as CustomNamedEntityDefault.xml.

Using the Custom Named Entity

Next, create a case and ingest data specifying the appropriate processing profile.

curl --location 'http://127.0.0.1:8080/nuix-restful-service/svc/cases/33ff69c0b451499dafbf1d17cd46a96c/evidence/file' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer BEARER' \
--data '{
   "target": {
    "path": "/my_data_directory"
  },
  "processingProfile": "CustomNamedEntityDefault"
}
'

Verification

Finally, verify the custom named entities are available using the Search endpoint with the following query named-entities:MyCNE;* where MyCNE is the value of the name field in the .cne file we initially created at the beginning of this walkthrough.

curl --location 'http://127.0.0.1:8080/nuix-restful-service/svc/cases/33ff69c0b451499dafbf1d17cd46a96c/evidence/search' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer BEARER' \
--data '{
  "query" : "named-entities:MyCNE;*",
  "metadataProfile": "Default"
}'