?You can generate an empty extract file by two methods:
You can enable this option using the W_FORCE_EMPTY_EXTRACTFILE parameter with values of Y or N in the w_config_custom.inc configuration file:
[estart dir]/tpe/dynamic/msgcenter/eagle_ml-2-0_custom_cm/w_config_custom.inc
For example, you can add the code below to force the Extract Service to generate a file for an empty extract:
Code Block |
---|
language | js |
---|
title | w_config_custom.inc |
---|
|
...
Code Block |
---|
|
<CODE>
:W_FORCE_EMPTY_EXTRACTFILE: := 'Y';
</CODE> |
After adding the code shown above, you need to reinitialize the MC2 rule cache.When the empty extract file option is enabled as shown, the REST simple extract requests returns an empty result:
...
Code Block |
---|
language | js |
---|
title | HTTP request example |
---|
|
<protocol>://<host>:<port>/eagle/v2/entities?entityselectiontype=EntityID&entityselectionvalue=NOTEXISTINGID&outputFormat=json |
This results in an empty body response because the result has been read from an empty extract file.The example below shows how you can change the W_FORCE_EMPTY_EXTRACTFILE parameter value to N.
Code Block |
---|
language | js |
---|
title | w_config_custom.inc |
---|
|
...
Code Block |
---|
|
<CODE>
:W_FORCE_EMPTY_EXTRACTFILE: := 'N';
</CODE> |
After adding the code above, you need to reinitialize the Extract Service. If the Force Empty Extract File option is not set or disabled, the Extract Service returns a NO_DATA TSR response:
Code Block |
---|
language | js |
---|
title | NO_DATA TSR response sample |
---|
|
Code Block |
---|
|
{
"header": {
"messageId": "MRX2FM3V9IVHXD9U",
"inReplyTo": "http://10.80.220.212:20220/extractservicerest/reply",
"sentBy": "http://www.eagleinvsys.com/",
"creationTimestamp": "2019-10-28T12:48:11-04:00"
},
"statusItem": [
{
"taskIdentifier": {
"correlationId": {
"value": "H7T1T1XP5Z574886X",
"correlationIdScheme": "correlationIdScheme"
},
"businessTaskId": {
"value": "H7T1T1XP5Z574886X",
"businessTaskIdScheme": "businessTaskIdScheme"
}
},
"status": "NO_DATA",
"severityCode": "0"
}
]
} |
...
Another way to control an empty extractfile generation is to use forceExtractFileCreation HTTP parameter with values Y or N for the specific request. The example below is an HTTP request example using the forceExtractFileCreation parameter:
Code Block |
---|
language | js |
---|
title | HTTP request example |
---|
|
<protocol>://<host>:<port>/eagle/v2/entities?entityselectiontype=EntityID&entityselectionvalue=NOTEXISTINGID&outputFormat=json&forceExtractFileCreation=Y |
...