Data Loss Prevention

 View Only
  • 1.  Messageheader is null

    Posted Jan 23, 2018 05:50 AM

    Hi,

     

    I used Symantec API to call the system via Java, but the column 'Messageheader' is all 'nan'. May I ask the possible reason and the solution? Thank you.

     

    #Java Code:

    #detailsList.add(incident.getMessageHeader() == null ? "" : incident.getMessageHeader().getName());



  • 2.  RE: Messageheader is null
    Best Answer

    Posted Jan 23, 2018 11:22 AM

    Hello Zhou,

     

    Did you put this :

    boolean includeViolations = true;

    request.setIncludeViolations(includeViolations);

     

    Sincerely yours



  • 3.  RE: Messageheader is null

    Trusted Advisor
    Posted Jan 23, 2018 07:04 PM

    hi

     You may check that role/user used to connect to the API has correct privileges to access these information.

     Regards



  • 4.  RE: Messageheader is null

    Posted Jan 23, 2018 08:46 PM

    The access right should be fine, because I can extract email body content, subject and most of other columns successfully. Only messageheader and emailbody have some issues. Thank you. 



  • 5.  RE: Messageheader is null

    Posted Jan 23, 2018 09:12 PM

    Hi Thomas,

     

    Thank you for your reply.

     

    Do you mean that I should include these lines under the same file with  below line?

    detailsList.add(incident.getMessageHeader() == null ? "" : incident.getMessageHeader().getName());

    Then my anwser is no, I didn't include the lines you mentioned in the same script with getmessageheader().

    But I found similar codes in other file 'IncidentDetails.java':

    #########################################################################

    public boolean isRequested(Map<String, String> arguments) {
    return (arguments.get("INCIDENT_ID") != null
    && (arguments.get("VIOLATIONS") == null || "false".equalsIgnoreCase(arguments.get("VIOLATIONS"))));
     
     
    public void submit(ReportingServiceClient client, Map<String, String> arguments) {
    IncidentDetailRequest request = new IncidentDetailRequest();
    for (String key : arguments.keySet()) {
    if (key.startsWith("INCIDENT_ID")) {
    request.getIncidentLongId().add(Long.parseLong(arguments.get(key)));
    }
     
    }
    request.setIncludeHistory(isTrue(arguments, "GET_HISTORY"));
    request.setIncludeViolations(isTrue(arguments, "GET_VIOLATIONS"));
     
    ########################################################################
     

    I understand the reason for your suggestion. The documentation says 'MessageHeader' and 'MessageBody' are provided only when you choose to include violation data in the incident detail request.  Maybe it is the potiential problem. But the question is coming, I still can extract 'MessageBodyContent' successfully, and the documentation also says 'MessageBodyContent' is provided only when you choose to include violation data in the incident detail request.

    Hence, maybe the problem is not in this part?

     

    Thank you very much.



  • 6.  RE: Messageheader is null

    Posted Jan 24, 2018 08:13 AM

    Hello Zhou,

     

    I think you just need to pass this value when launching the script : GET_HISTORY=True

    in incidentDetails.jav you found :

    /**
         * <summary>
         * Check if Enforce incident details
         * are requested.
         *
         * Supported arguments:
         *
         * INCIDENT_ID=...     - incident id
         * GET_HISTORY=True    - to retrieve incident history with details, optional default to false
         * GET_VIOLATIONS=True - to retrieve policy rule violations with details, optional default to false
         *
         * </summary>
         * <param name="arguments">arguments(INCIDENT_ID and GET_HISTORY, GET_VIOLATIONS)</param>
         * <returns>True if arguments contain INCIDENT_ID or INCIDENT_LONGID</returns>

     

    Sincerely yours



  • 7.  RE: Messageheader is null

    Posted Jan 24, 2018 09:30 PM

    Thanks Thomas,

     

    But I have checked the code, I think I have set it as 'TRUE' when I run the code in command line. Will other potiential problems cause this problem?

     

    Thank you. 



  • 8.  RE: Messageheader is null

    Posted Feb 01, 2018 05:04 AM

    Hello Zhou,

     

    As Stephane asked, did you check that the user who run this script has the right privilege to see history ?

    /connect/sites/default/files/users/user-3956181/Capture.PNG

    Sincerely yours