Part 12: Case Subset

Subset case data into a new case.

Case Subset

Let’s create a case subset of our tagged HTML files using the query tag:HTMLFiles.

curl --location --request POST 'http://localhost:8080/nuix-restful-service/svc/v1/cases/43b070164ce8453ca30ed9e2dfcce67b/subset' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
	"query": "tag:HTMLfiles",
	"location": "inventory0",
	"evidenceStoreCount": 1,
	"includeFamilies": false,
	"copyTags": false,
	"copyComments": false,
	"copyCustodians": false,
	"copyItemSets": false,
	"copyClassifiers": false,
	"copyMarkupSets": false,
	"copyProductionSets": false,
	"copyClusters": false,
	"copyCustomMetadata": false,
	"caseMetadata": {
		"name": "HelloHTMLFiles",
		"description": "HTML files case subsetted",
		"investigator":"Inspector Gadget"
	}
}'
{
    "functionKey": "7cdcba36-7d9d-4d55-a9f7-b0e179fa5162",
    "location": "http://localhost:8080/nuix-restful-service/svc/v1/asyncFunctions/7cdcba36-7d9d-4d55-a9f7-b0e179fa5162"
}

Case Subset Status

The functionKey field returned from the case subset endpoint above can be polled for status.

curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v1/asyncFunctions/7cdcba36-7d9d-4d55-a9f7-b0e179fa5162' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d'
{
    "done": true,
    "cancelled": false,
    "result": "cc58650fb513494e944166cfb39494d5",
    "token": "7a40f78e-48f0-4a2c-b9aa-423251e2b4c1",
    "functionKey": "7cdcba36-7d9d-4d55-a9f7-b0e179fa5162",
    "progress": 314,
    "total": 1,
    "percentComplete": 31400.0000,
    "updatedOn": 1613163116856,
    "status": null,
    "statusId": null,
    "requestTime": 1613163085787,
    "startTime": 1613163090254,
    "finishTime": 1613163121958,
    "caseId": "43b070164ce8453ca30ed9e2dfcce67b",
    "caseName": "HelloWorld",
    "hasSuccessfullyCompleted": true,
    "friendlyName": "Case Subset Function",
    "caseLocation": "/Cases/HelloWorld",
    "requestor": "nuixadmin",
    "action": "AsyncCaseSubsetFunction",
    "options": {
        "query": "tag:HTMLfiles",
        "options": {
            "copyComments": false,
            "copyCustodians": false,
            "evidenceStoreCount": 1,
            "copyCustomMetadata": false,
            "copyItemSets": false,
            "copyProductionSets": false,
            "copyTags": false,
            "copyClusters": false,
            "copyMarkupSets": false,
            "includeFamilies": false,
            "copyClassifiers": false,
            "caseMetadata": {
                "investigator": "Inspector Gadget",
                "name": "HelloHTMLFiles",
                "description": "HTML files case subsetted",
                "binaryStoreLocation": null
            }
        },
        "location": "/Cases/HelloHTMLFiles"
    },
    "participatingInCaseFunctionQueue": true,
    "processedBy": "nuix-restful-server-2",
    "errorMsg": null
}

Inventory Verification

The result field in the polled response is the case ID of the newly created case. Let’s verify it exists in our inventory.

curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v1/inventory/digest' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d'
[
      {
        "caseId": "43b070164ce8453ca30ed9e2dfcce67b",
        "name": "HelloWorld",
        "path": "/Cases/HelloWorld",
        "description": "My first simple Nuix case",
        "investigator": "Inspector Gadget",
        "creationDate": 1612906749154,
        "compound": false,
        "elastic": false,
        "binaryStoreLocation": "",
        "indexId": "",
        "productName": "Nuix",
        "version": "8.9.1",
        "isOpen": false,
        "childCases": [],
        "url": "http://localhost:8080",
        "serverId": "nuix-restful-server-1"
     }, 
     {
        "caseId": "cc58650fb513494e944166cfb39494d5",
        "name": "HelloHTMLFiles",
        "path": "/Cases/HelloHTMLFiles",
        "description": "HTML files case subsetted",
        "investigator": "Inspector Gadget",
        "creationDate": 1613163100246,
        "compound": false,
        "elastic": false,
        "binaryStoreLocation": "",
        "indexId": "",
        "productName": "Nuix",
        "version": "8.9.1",
        "isOpen": false,
        "childCases": [],
        "url": "http://localhost:8080",
        "serverId": "nuix-restful-server-1"
    }
]

The new case HelloHTMLFiles is in the inventory with case ID cc58650fb513494e944166cfb39494d5.

Elasticsearch Case Subset

We can also take our HelloWorld case, and create a case subset for an Elasticsearch case. Let’s try it out. Elasticsearch settings are provided in the caseMetadata field.

curl --location --request POST 'http://localhost:8080/nuix-restful-service/svc/v1/cases/43b070164ce8453ca30ed9e2dfcce67b/subset' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d'
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
	"query": "tag:HTMLfiles",
	"location": "inventory0",
	"evidenceStoreCount": 1,
	"includeFamilies": false,
	"copyClassifiers": false,
	"copyMarkupSets": false,
	"copyProductionSets": false,
	"copyClusters": false,
	"copyCustomMetadata": false,
	"caseMetadata": {
		"name": "HelloElasticHTMLFiles",
		"description": "HTML files case subsetted into Elasticsearch",
		"investigator":"Inspector Gadget",
        "elasticSearchSettings" : {
            "cluster.name": "elasticsearch",
            "nuix.transport.hosts": ["127.0.0.1"],
            "nuix.http.hosts": ["127.0.0.1"],
            "index.number_of_shards": 1
        }
	}
}'
{
    "functionKey": "ec04c044-66f6-4f9e-af4f-583b51f22d55",
    "location": "http://localhost:8080/nuix-restful-service/svc/v1/asyncFunctions/ec04c044-66f6-4f9e-af4f-583b51f22d55"
}

Elasticsearch Case Subset Status

Again, the functionKey field returned from the case subset endpoint above can be polled for status.

curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v1/asyncFunctions/ec04c044-66f6-4f9e-af4f-583b51f22d55' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d'
--header 'Cookie: JSESSIONID=64EC387C1A3CD403896EF14506B03BD9'
{
    "done": true,
    "cancelled": false,
    "result": "664649c33a064ba796b28f65caac77c2",
    "token": "7a40f78e-48f0-4a2c-b9aa-423251e2b4c1",
    "functionKey": "ec04c044-66f6-4f9e-af4f-583b51f22d55",
    "progress": 0,
    "total": 1,
    "percentComplete": 0.0000,
    "updatedOn": 1613164209724,
    "status": null,
    "statusId": null,
    "requestTime": 1613164206990,
    "startTime": 1613164209722,
    "finishTime": 1613164215014,
    "caseId": "43b070164ce8453ca30ed9e2dfcce67b",
    "caseName": "HelloWorld",
    "hasSuccessfullyCompleted": true,
    "friendlyName": "Case Subset Function",
    "caseLocation": "/Cases/HelloWorld",
    "requestor": "nuixadmin",
    "action": "AsyncCaseSubsetFunction",
    "options": {
        "query": "tag:HTMLfiles",
        "options": {
            "copyComments": false,
            "copyCustodians": false,
            "evidenceStoreCount": 1,
            "copyCustomMetadata": false,
            "copyItemSets": false,
            "copyProductionSets": false,
            "copyTags": false,
            "copyClusters": false,
            "copyMarkupSets": false,
            "includeFamilies": false,
            "copyClassifiers": false,
            "caseMetadata": {
                "investigator": "Inspector Gadget",
                "name": "HelloElasticHTMLFiles",
                "description": "HTML files case subsetted into Elasticsearch",
                "binaryStoreLocation": null,
                "elasticSearchSettings": {
                    "index.refresh_interval": "60s",
                    "nuix.transport.hosts": [
                        "127.0.0.1"
                    ],
                    "cluster.name": "elasticsearch",
                    "index.number_of_replicas": 0,
                    "nuix.http.hosts": [
                        "127.0.0.1"
                    ],
                    "nuix.index.auto_close": false,
                    "index.number_of_shards": 1,
                    "xpack.security.transport.ssl.enabled": false
                }
            }
        },
        "location": "/Cases/HelloElasticHTMLFiles"
    },
    "participatingInCaseFunctionQueue": true,
    "processedBy": "nuix-restful-server-2",
    "errorMsg": null
}

Inventory Verification

The result field in the polled response is the case ID of the newly created Elasticsearch case. Let’s verify it exists in our inventory.

curl --location --request GET 'http://localhost:8080/nuix-restful-service/svc/v1/inventory/digest' \
--header 'nuix-auth-token: 9729a460-eda7-48dc-ba70-d12b3aae3c8d'
[
     {
        "caseId": "43b070164ce8453ca30ed9e2dfcce67b",
        "name": "HelloWorld",
        "path": "/Cases/HelloWorld",
        "description": "My first simple Nuix case",
        "investigator": "Inspector Gadget",
        "creationDate": 1612906749154,
        "compound": false,
        "elastic": false,
        "binaryStoreLocation": "",
        "indexId": "",
        "productName": "Nuix",
        "version": "8.9.1",
        "isOpen": false,
        "childCases": [],
        "url": "http://localhost:8080",
        "serverId": "nuix-restful-server-1"
     }, 
     {
        "caseId": "cc58650fb513494e944166cfb39494d5",
        "name": "HelloHTMLFiles",
        "path": "/Cases/HelloHTMLFiles",
        "description": "HTML files case subsetted",
        "investigator": "Inspector Gadget",
        "creationDate": 1613163100246,
        "compound": false,
        "elastic": false,
        "binaryStoreLocation": "",
        "indexId": "",
        "productName": "Nuix",
        "version": "8.9.1",
        "isOpen": false,
        "childCases": [],
        "url": "http://localhost:8080",
        "serverId": "nuix-restful-server-1"
    },
    {
        "caseId": "664649c33a064ba796b28f65caac77c2",
        "name": "HelloElasticHTMLFiles",
        "path": "/Cases/HelloElasticHTMLFiles",
        "description": "HTML files case subsetted into Elasticsearch",
        "investigator": "Inspector Gadget",
        "creationDate": 1613164125600,
        "compound": false,
        "elastic": true,
        "binaryStoreLocation": "/Cases/HelloElasticHTMLFiles/Stores/BinaryStore",
        "indexId": "nuix-664649c33a064ba796b28f65caac77c2",
        "productName": "Nuix",
        "version": "8.9.1",
        "isOpen": false,
        "childCases": [],
        "url": "http://localhost:8080",
        "serverId": "nuix-restful-server-1"
    }
]

The new case HelloElasticHTMLFiles is in the inventory with case ID 664649c33a064ba796b28f65caac77c2.

Last modified February 12, 2021