<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Output JSON for Incident Mapping in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389470#M162</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have several incidents that we need to work on the mapping of, but they are relatively rare and are not pulled from the (SplunkPy) integration often enough that they are in any of the events that we get when we do the mapping (6.0) and pull from the integration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They have been classified correctly, and we have several instances in XSOAR, so what we would like to do is to export the JSON from an existing incident and load it into the mapper to map the fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've tried several commands (PrintContext and DumpJSON) but neither seem to give us the incident entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we best export events as JSON to load into the mapper and map fields?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 20:41:43 GMT</pubDate>
    <dc:creator>Sean_L</dc:creator>
    <dc:date>2021-03-05T20:41:43Z</dc:date>
    <item>
      <title>Output JSON for Incident Mapping</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389470#M162</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We have several incidents that we need to work on the mapping of, but they are relatively rare and are not pulled from the (SplunkPy) integration often enough that they are in any of the events that we get when we do the mapping (6.0) and pull from the integration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They have been classified correctly, and we have several instances in XSOAR, so what we would like to do is to export the JSON from an existing incident and load it into the mapper to map the fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've tried several commands (PrintContext and DumpJSON) but neither seem to give us the incident entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we best export events as JSON to load into the mapper and map fields?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 20:41:43 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389470#M162</guid>
      <dc:creator>Sean_L</dc:creator>
      <dc:date>2021-03-05T20:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Output JSON for Incident Mapping</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389491#M163</link>
      <description>&lt;P&gt;Hi Sean,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your current mapper, do you map any unmapped fields into the labels in the context data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 22:41:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389491#M163</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-05T22:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Output JSON for Incident Mapping</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389615#M165</link>
      <description>&lt;P&gt;Yes we do&lt;/P&gt;</description>
      <pubDate>Sun, 07 Mar 2021 18:14:32 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389615#M165</guid>
      <dc:creator>Sean_L</dc:creator>
      <dc:date>2021-03-07T18:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Output JSON for Incident Mapping</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389720#M167</link>
      <description>&lt;P&gt;You could export an existing incident and make the labels the main fields on the incident and use this JSON as a file input into the mapping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, create an automation script called "exportIncidentLabels" and use the following code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;incident = demisto.incident().get('labels', {})
parsed_incident = dict()

for item in incident:
    parsed_incident[item['type']] = item['value']

demisto.results([json.dumps(parsed_incident)])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then execute it from the war room of the desired incident that contains the relevant labels. When the results show, download them as a file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_0-1615205436695.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30223i0E0C5C5FCCB4B9C8/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="ABurt_0-1615205436695.png" alt="ABurt_0-1615205436695.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_1-1615205468654.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30224i6DC2FC54BA8C5A80/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="ABurt_1-1615205468654.png" alt="ABurt_1-1615205468654.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_2-1615205499328.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30225i4F6D52D655C4BBB2/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="ABurt_2-1615205499328.png" alt="ABurt_2-1615205499328.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then open the mapper and use:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_3-1615205576784.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30226i1F8DC4CCF6D5C05B/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="ABurt_3-1615205576784.png" alt="ABurt_3-1615205576784.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ABurt_4-1615205646092.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/30227i64CE37CB28FA3235/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="ABurt_4-1615205646092.png" alt="ABurt_4-1615205646092.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However you get the data out, the mapper JSON input file expects a JSON list of dictionaries. Each array entry is considered a new incident and the JSON dictionary is considered the "rawJSON" input into an incident.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "incident1_field1": "value1",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "incident1_field2": "value2"&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "incident2_field1": "value1",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "incident2_field2": "value2"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 12:19:35 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/389720#M167</guid>
      <dc:creator>ABurt</dc:creator>
      <dc:date>2021-03-08T12:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Output JSON for Incident Mapping</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/390689#M170</link>
      <description>&lt;P&gt;So I finally got around to it and I added the script.&amp;nbsp; It outputs the labels nicely.&amp;nbsp; I ran them though CyberChef to make sure everything was correct, and there were no formatting issue, but when I upload in the Mapping Editor I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="oops-title"&gt;&lt;SPAN&gt;Error parsing request&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="oops-details"&gt;Request body is not well-formed. It must be JSON.&lt;/DIV&gt;&lt;DIV class="oops-details"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="oops-error"&gt;&lt;STRONG&gt;&lt;SPAN&gt;Error details&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;PRE&gt;json: cannot unmarshal number into Go struct field queryDTOnList.list of type map[string]interface {}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the same message I get when I export from Splunk as JSON as well.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Mar 2021 18:04:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/390689#M170</guid>
      <dc:creator>Sean_L</dc:creator>
      <dc:date>2021-03-11T18:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Output JSON for Incident Mapping</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/390696#M171</link>
      <description>&lt;P&gt;I figured out.&amp;nbsp; The JSON needs top be enclosed in '[' and ']' for it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding this to the start and end of the file after the export from the script worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 18:09:28 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/output-json-for-incident-mapping/m-p/390696#M171</guid>
      <dc:creator>Sean_L</dc:creator>
      <dc:date>2021-03-11T18:09:28Z</dc:date>
    </item>
  </channel>
</rss>

