1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
import time
class ElasticsearchCaseSubset:
def __init__(self, exportPath, query):
self.exportPath = exportPath
self.query = query
self.out = {}
self.exceptions = []
def process(self):
try:
items = current_case.search(self.query);
self.out['item_count'] = len(items)
self.out['exportPath'] = self.exportPath
options = {
"evidenceStoreCount": 1,
"includeFamilies": False,
"copyTags": False,
"copyComments": False,
"copyCustodians": False,
"copyItemSets": False,
"copyClassifiers": False,
"copyMarkupSets": False,
"copyProductionSets": False,
"copyClusters": False,
"copyCustomMetadata": False,
"caseMetadata": {
"name": "ESCaseSubset",
"description": "About My simple Case",
"investigator": "Inspector Gadget",
"elasticSearchSettings": {
"index.refresh_interval": "60s",
"nuix.transport.hosts": "127.0.0.1:9300",
"cluster.name": "elasticsearch",
"index.number_of_replicas": "0",
"nuix.index.auto_close": "false",
"index.number_of_shards": "5",
"xpack.security.transport.ssl.enabled": "false"
}
}
}
self.out['started'] = int(round(time.time() * 1000))
utilities.getCaseSubsetExporter().exportItems(items, self.exportPath, options);
except Exception, e:
self.exceptions.append(str(e))
self.out['finished'] = int(round(time.time() * 1000))
return self.out
processor = ElasticsearchCaseSubset("/Cases/ESCaseSubsetUserScript", "file-extension:html")
response.setBody(processor.process())
|