<?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: Debugging python from the command line that needs a session key in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/682901#M114015</link>
    <description>&lt;P&gt;Assuming you are on a linux machine, you could try piping the session_key value to that first command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo "sessionkeyhere" | splunk cmd python -m pdb netskope_email_notification.py&lt;/LI-CODE&gt;&lt;P&gt;(Note that if you enter the key in explicitly, it may be saved in your command history which may be undesired. You can also read the key from a source using the "cat" command)&lt;/P&gt;&lt;P&gt;I couldn't tell you about the session_key... perhaps the Netskope docs could tell you where to get one. It could be a session with an email provider if this python script is intended to send email.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2024 20:39:35 GMT</pubDate>
    <dc:creator>marnall</dc:creator>
    <dc:date>2024-04-02T20:39:35Z</dc:date>
    <item>
      <title>Debugging python from the command line that needs a session key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/679052#M113478</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I'm trying to debug netskope_email_notification.py from the TA-NetSkopeAppForSplunk by running this command.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;splunk cmd python -m pdb netskope_email_notification.py&lt;/LI-CODE&gt;
&lt;P&gt;It runs until it hits this line&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;session_key = sys.stdin.readline().strip()&lt;/LI-CODE&gt;
&lt;P&gt;How do I get past this?&amp;nbsp; Maybe something like this, but with a session key.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;splunk cmd python -m pdb netskope_email_notification.py &amp;lt; session_key&lt;/LI-CODE&gt;
&lt;P&gt;If so, how do you create an external session key?&lt;/P&gt;
&lt;P&gt;TIA,&lt;/P&gt;
&lt;P&gt;Joe&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 21:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/679052#M113478</guid>
      <dc:creator>jwhughes58</dc:creator>
      <dc:date>2024-02-28T21:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging python from the command line that needs a session key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/682901#M114015</link>
      <description>&lt;P&gt;Assuming you are on a linux machine, you could try piping the session_key value to that first command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;echo "sessionkeyhere" | splunk cmd python -m pdb netskope_email_notification.py&lt;/LI-CODE&gt;&lt;P&gt;(Note that if you enter the key in explicitly, it may be saved in your command history which may be undesired. You can also read the key from a source using the "cat" command)&lt;/P&gt;&lt;P&gt;I couldn't tell you about the session_key... perhaps the Netskope docs could tell you where to get one. It could be a session with an email provider if this python script is intended to send email.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 20:39:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/682901#M114015</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-04-02T20:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging python from the command line that needs a session key</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/682902#M114016</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; I hadn't thought of that.&amp;nbsp; Since I posted the question, NetSkope came back with a solution.&amp;nbsp; I was sent this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;conf_file_stanzas = conf_file_object.get_all()
&amp;nbsp;
replace the above line with following:
&amp;nbsp;
conf_file_stanzas = conf_file_object.get_all(only_current_app=True)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;With that the issue was resolved.&amp;nbsp; The code was trying to get information from another TA.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 20:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Debugging-python-from-the-command-line-that-needs-a-session-key/m-p/682902#M114016</guid>
      <dc:creator>jwhughes58</dc:creator>
      <dc:date>2024-04-02T20:45:08Z</dc:date>
    </item>
  </channel>
</rss>

