<?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 Negating an Argument for XML API Query in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596792#M118732</link>
    <description>&lt;P&gt;I am essentially trying to query the XML API for the active firewall to grab out operational logs using the below query except I would like to NEGATE the application so that I am grabbing out the logs that do not include that application type. Right now as it is written below, I am grabbing out ONLY the logs with application type "example-application-type-here" and I would like the opposite. Has anyone resolved this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;application&amp;gt;example-application-type-here&amp;lt;/application&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 18:55:42 GMT</pubDate>
    <dc:creator>Molly_Rice</dc:creator>
    <dc:date>2024-09-04T18:55:42Z</dc:date>
    <item>
      <title>Negating an Argument for XML API Query</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596792#M118732</link>
      <description>&lt;P&gt;I am essentially trying to query the XML API for the active firewall to grab out operational logs using the below query except I would like to NEGATE the application so that I am grabbing out the logs that do not include that application type. Right now as it is written below, I am grabbing out ONLY the logs with application type "example-application-type-here" and I would like the opposite. Has anyone resolved this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;application&amp;gt;example-application-type-here&amp;lt;/application&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 18:55:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596792#M118732</guid>
      <dc:creator>Molly_Rice</dc:creator>
      <dc:date>2024-09-04T18:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Negating an Argument for XML API Query</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596880#M118733</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/324465"&gt;@Molly_Rice&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am essentially trying to query the XML API for the active firewall to grab out operational logs using the below query except I would like to NEGATE the application so that I am grabbing out the logs that do not include that application type. Right now as it is written below, I am grabbing out ONLY the logs with application type "example-application-type-here" and I would like the opposite. Has anyone resolved this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;application&amp;gt;example-application-type-here&amp;lt;/application&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you use a 'not' operator somewhere in-front of the application field or maybe the 'bang' !&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 20:13:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596880#M118733</guid>
      <dc:creator>Brandon_Wertz</dc:creator>
      <dc:date>2024-09-04T20:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Negating an Argument for XML API Query</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596885#M118734</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/324465"&gt;@Molly_Rice&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The way that you would do this through the API (and the way that the GUI actually performs this) is simply not outputting the full return. Something a bit like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;session_table = requests.get('https://&amp;lt;firewall&amp;gt;/api/?type=op&amp;amp;cmd=&amp;lt;validate&amp;gt;&amp;lt;full&amp;gt;&amp;lt;/full&amp;gt;&amp;lt;/validate&amp;gt;',headers=headers, verify=False)
session_dict = xmltodict.parse(session_table.content)
returned_session_list = []
session_list = session_dict['response']['result']['entry']
for session in session_list:
    if session['application'] == 'ssl':
        logging.debug("Drop Session")
    else:
        returned_session_list.append(session)
## Do something with returned_session_list ##
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Sep 2024 20:30:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/negating-an-argument-for-xml-api-query/m-p/596885#M118734</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2024-09-04T20:30:27Z</dc:date>
    </item>
  </channel>
</rss>

