<?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: Command line &amp;quot;show session all&amp;quot; limited to 1024 entries in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185185#M56685</link>
    <description>&lt;P&gt;Since you seem to be just looking for the count instead of details, as you iterate through your user list, add a "count yes" to your request.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;show session all filter source-user domain\username count yes&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or in XML format (you'll want to test this, I didn't):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;source-user&amp;gt;$user&amp;lt;/source-user&amp;gt;&amp;lt;count&amp;gt;yes&amp;lt;/count&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You won't get any details at all about the types of sessions, packets, apps, etc. but you will get the raw count data.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2017 16:48:54 GMT</pubDate>
    <dc:creator>gwesson</dc:creator>
    <dc:date>2017-11-02T16:48:54Z</dc:date>
    <item>
      <title>Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185098#M56673</link>
      <description>&lt;P&gt;First some information on the use case:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;500 users&lt;/LI&gt;&lt;LI&gt;each user is generating approximately 10 simultaneous sessions =&amp;gt; 5000 simultaneous sessions&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I would like to get the amount of current sessions per user, from the command line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently use the API to basically do:&lt;/P&gt;&lt;PRE&gt;for user in $user_list; do
  panxapi.py -jo " &amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;source-user&amp;gt;$user&amp;lt;/source-user&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;"
done&lt;/PRE&gt;&lt;P&gt;However, the above for loop takes a large amount of time (approx 50 seconds for 500 users) and is stressing the Palo Alto quite a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried the following:&lt;/P&gt;&lt;PRE&gt;for i in 1 1025 2049 3073 4097; do
   panxapi.py -jo "&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;start-at&amp;gt;$i&amp;lt;/start-at&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;"
done&lt;/PRE&gt;&lt;P&gt;But I am not sure that this gives a consistent list of sessions.&lt;/P&gt;&lt;P&gt;A better understanding of how the "start-at" filter works would help me evaluate the consistency of the above loop:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;can I miss some sessions?&lt;/LI&gt;&lt;LI&gt;can I get the same session returned twice between 2 panxapi runs?&lt;/LI&gt;&lt;LI&gt;or maybe there's a better way to grab those sessions that I don't see?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 09:57:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185098#M56673</guid>
      <dc:creator>hgiguelay</dc:creator>
      <dc:date>2017-11-02T09:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185185#M56685</link>
      <description>&lt;P&gt;Since you seem to be just looking for the count instead of details, as you iterate through your user list, add a "count yes" to your request.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;show session all filter source-user domain\username count yes&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or in XML format (you'll want to test this, I didn't):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;all&amp;gt;&amp;lt;filter&amp;gt;&amp;lt;source-user&amp;gt;$user&amp;lt;/source-user&amp;gt;&amp;lt;count&amp;gt;yes&amp;lt;/count&amp;gt;&amp;lt;/filter&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You won't get any details at all about the types of sessions, packets, apps, etc. but you will get the raw count data.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 16:48:54 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185185#M56685</guid>
      <dc:creator>gwesson</dc:creator>
      <dc:date>2017-11-02T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185191#M56686</link>
      <description>&lt;P&gt;Thanks Gwesson,&lt;/P&gt;&lt;P&gt;Sorry I wasn't clear enough when I said "amount of current sessions per user"&lt;/P&gt;&lt;P&gt;I don't want the session count, I want the total amount of bytes.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 17:04:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185191#M56686</guid>
      <dc:creator>hgiguelay</dc:creator>
      <dc:date>2017-11-02T17:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185224#M56691</link>
      <description>&lt;P&gt;In that case, I don't know of anything that can get that granular. Even if you could get all the sessions for each user in a fairly short amount of time (a couple minutes, for example) it wouldn't be accurate by the time you were done. Especially if you have several users streaming HD video or downloading large files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reporting would probably get you a better sense of what's going on without the difficulties of getting a real-time snapshot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you still want that data, you may want to filter it further than just&amp;nbsp;all sessions, maybe just get the sessions larger than x-bytes so you don't see all the tiny sessions you don't really care about. Think about how a typical web session will generate many DNS queries that are individual sessions but typically only 2 packets with almost no bytes. Use the "min-kb" filter to get the filtered data with more relevant info.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 18:10:35 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185224#M56691</guid>
      <dc:creator>gwesson</dc:creator>
      <dc:date>2017-11-02T18:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185286#M56703</link>
      <description>&lt;P&gt;Thanks for your tips &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/28203"&gt;@gwesson&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Undeed the min-kb is a good idea! The best lead we have so far: other filters would not be filtering enough (although we might combine the min-kb with other filters, for further filtering)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, even with a reasonably high min-kb value (say 50Kb), our projections show that we will still be above the 1024 limitation, so we may still need to run a few "start-at" commands and aggregate those, hence the consistency issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end, consistency might not be a huge issue, running a few sequential "start-at" commands may not give a lot of "intersections" or "holes", and we can work with some error margin.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 08:22:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185286#M56703</guid>
      <dc:creator>hgiguelay</dc:creator>
      <dc:date>2017-11-03T08:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185290#M56704</link>
      <description>&lt;P&gt;A filter that would also be greatly filtering would be some way to only get user-tagged traffic. Some things I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. filter on subnet (in our case, user tagged traffic appear on&amp;nbsp;different subnets than non user-tagged):&lt;/P&gt;&lt;PRE&gt;show session all filter source 10.10.10.0/24&lt;/PRE&gt;&lt;P&gt;2. filter on traffic&amp;nbsp;user-tagged:&lt;/P&gt;&lt;PRE&gt;show session all filter source-user *&lt;BR /&gt;show session all filter source-user any&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, the above commands don't work.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2017 08:36:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185290#M56704</guid>
      <dc:creator>hgiguelay</dc:creator>
      <dc:date>2017-11-03T08:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Command line "show session all" limited to 1024 entries</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185633#M56770</link>
      <description>I don't think you'll be able to filter on a source-user like that. The simple reason being it doesn't get logged as a 'known-user' it get's logged as the user that went there. When you utilize 'known-user' or 'unknown-user' in a security policy the check is simply 'does this IP have a user-id listed'. If it returns any user the 'known-user' rule will function, if it returns unknown then the unknown-user rule will trigger. When looking at logs you really won't be able to filter like that, and even if you could the CPU hit of doing so would cause the same issues that you are running into now.</description>
      <pubDate>Mon, 06 Nov 2017 18:10:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/command-line-quot-show-session-all-quot-limited-to-1024-entries/m-p/185633#M56770</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2017-11-06T18:10:20Z</dc:date>
    </item>
  </channel>
</rss>

