<?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 Re: Prisma Cloud Event Search API - Include data.items[].rawEvent in response in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-cloud-event-search-api-include-data-items-rawevent-in/m-p/511745#M614</link>
    <description>&lt;P&gt;Greetings THolmes,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that this note finds you well! I know that it has been a while since you had posted this question but I wanted to see if you still potentially needed any help. Thank you for your time and I hope that you have a good remainder of your day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;J. Avery King&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2022 16:54:33 GMT</pubDate>
    <dc:creator>AKing9</dc:creator>
    <dc:date>2022-08-12T16:54:33Z</dc:date>
    <item>
      <title>Prisma Cloud Event Search API - Include data.items[].rawEvent in response</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-cloud-event-search-api-include-data-items-rawevent-in/m-p/347881#M303</link>
      <description>&lt;P&gt;In my organization we have Prisma Cloud integrated into AWS Organization environment.&amp;nbsp; Which is great for monitoring and pulling data from the entire AWS Org.&amp;nbsp; I want to pull the count of all ec2 instances which are created using the&amp;nbsp;&lt;SPAN&gt;RunInstances call.&amp;nbsp; The event search works great for the number of times the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RunInstances is called, but in the rawEvent data several instances can be started from one call to RunInstances.&amp;nbsp; The below api call will receive the data from Prisma:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;timePeriod = {
            "type": "absolute",
            "value": {
                "startTime": 1596240000000,
                "endTime": 1598918399000
            }
        }
rqlQuery="event where operation = 'RunInstances'"
limit=250

prismaToken = prismaAPI.prismaLogin(apiKey,apiSecret)
query = {"limit":limit, "query": rqlQuery, "timeRange": timePeriod}
totalInstances=0
prismaQueryResult = prismaAPI.prismaQuery(prismaToken, query,'event')
 
def prismaQuery(pToken, rql, type='config'):

    url = f"https://api3.prismacloud.io/search/{type}" if type != 'network' else "https//api3.prismacloud.io/search"
    print(f'rql: {rql}')
    try:
        headers = {
            'accept': "application/json; charset=UTF-8",
            'content-type': "application/json; charset=UTF-8",
            'x-redlock-auth': pToken
        }
        response = requests.request("POST", url, headers=headers, json=rql)
        response.raise_for_status()
        return response.json()
    except HTTPError as http_err:
        print(f'HTTP error occurred: {http_err}')  
    except Exception as err:
        print(f'Other error occurred: {err}') 
    else:
        print('Success!')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but the raw event data is not included in the response.&amp;nbsp; So then I need to make a call for every event to the&amp;nbsp;&lt;SPAN class="url"&gt;&lt;A href="https://api.prismacloud.io" target="_blank" rel="noopener"&gt;https://api.prismacloud.io&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="api-text"&gt;/search/event/raw/&lt;/SPAN&gt;&lt;SPAN class="api-variable"&gt;id endpoint.&amp;nbsp; Is there some way to get the rawEvent data in the initial search api call?&amp;nbsp; There is a&amp;nbsp;data.items[].rawEvent shown as possible response information.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="api-variable"&gt;Thank you,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="api-variable"&gt;Trevor&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 17:12:01 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-cloud-event-search-api-include-data-items-rawevent-in/m-p/347881#M303</guid>
      <dc:creator>THolmes</dc:creator>
      <dc:date>2022-08-12T17:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Prisma Cloud Event Search API - Include data.items[].rawEvent in response</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-cloud-event-search-api-include-data-items-rawevent-in/m-p/511745#M614</link>
      <description>&lt;P&gt;Greetings THolmes,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that this note finds you well! I know that it has been a while since you had posted this question but I wanted to see if you still potentially needed any help. Thank you for your time and I hope that you have a good remainder of your day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards,&lt;/P&gt;
&lt;P&gt;J. Avery King&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 16:54:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-cloud-event-search-api-include-data-items-rawevent-in/m-p/511745#M614</guid>
      <dc:creator>AKing9</dc:creator>
      <dc:date>2022-08-12T16:54:33Z</dc:date>
    </item>
  </channel>
</rss>

