<?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: API URL Logs Issue in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/api-url-logs-issue/m-p/466916#M102733</link>
    <description>&lt;P&gt;Hey &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/209866"&gt;@mehixiyo&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;Isn't the correct filed "user.src" not src.user? Are you sure you are looking for correct field?&lt;/P&gt;</description>
    <pubDate>Fri, 18 Feb 2022 20:52:19 GMT</pubDate>
    <dc:creator>aleksandar.astardzhiev</dc:creator>
    <dc:date>2022-02-18T20:52:19Z</dc:date>
    <item>
      <title>API URL Logs Issue</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/api-url-logs-issue/m-p/466426#M102685</link>
      <description>&lt;P&gt;In the below code - I"m using the API to query the URL logs. It works great.&lt;/P&gt;&lt;P&gt;What isn't returning though is the src.user field, if it's mapped. How can I get this value? Do I need to do a separate query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Build PAN API Connection and get token
pan_conn = pan.xapi.PanXapi(api_username=args.pan_username,
                            api_password=args.pan_password,
                            hostname=args.pan_hostname,
                            timeout=5.000,
                            ssl_context=None)

url = args.url

tld = get_tld(url.replace("\\", ""), fail_silently=True)
if tld is None:
    logger.warning('No TLD Returned, falling back to URL')
    tld = url
elif tld:
    logger.info('Found TLD')

# Set time window to look back
if args.lookback == '15m':
    lookback_window = '15-minutes'
elif args.lookback == '1h':
    lookback_window = 'hour'

query = "(url contains '{0}') and (time_generated in last-{1})".format(tld, str(lookback_window))
action = 'log'
log_type = 'url'

options = {
    'log': log_type,
    'filter': query,
    'print_xml': False,
    'print_json': True,
    'print_result': True,
    'print_python': False,
    'print_text': True
}
logger.info(url)
logger.info(query)
log = pan_conn.log(log_type=options['log'], filter=options['filter'], nlogs=20, timeout=30)

print_status(pan_conn, action)
print_response(pan_conn, options)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Feb 2022 05:13:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/api-url-logs-issue/m-p/466426#M102685</guid>
      <dc:creator>mehixiyo</dc:creator>
      <dc:date>2022-02-17T05:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: API URL Logs Issue</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/api-url-logs-issue/m-p/466916#M102733</link>
      <description>&lt;P&gt;Hey &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/209866"&gt;@mehixiyo&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;Isn't the correct filed "user.src" not src.user? Are you sure you are looking for correct field?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 20:52:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/api-url-logs-issue/m-p/466916#M102733</guid>
      <dc:creator>aleksandar.astardzhiev</dc:creator>
      <dc:date>2022-02-18T20:52:19Z</dc:date>
    </item>
  </channel>
</rss>

