<?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 Local variable 'data' referenced before assignment in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452066#M55583</link>
    <description>&lt;P&gt;Fellow OMS Splunkers, what do you think about these messages?  &lt;/P&gt;

&lt;P&gt;Using:  &lt;CODE&gt;Type=SecurityBaseline AnalyzeResult=Failed&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;06-28-2019 15:57:21.704 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" ERRORlocal variable 'data' referenced before assignment


06-28-2019 15:57:21.677 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" UnboundLocalError: local variable 'data' referenced before assignment

06-28-2019 15:57:21.677 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"     for i in range(len(data["tables"][0]["rows"])):
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using: AzureActivity  | summarize count() by Category&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-06-28 15:58:54,518 ERROR pid=130483 tid=MainThread file=base_modinput.py:log_error:307 | Get error when collecting events.
Traceback (most recent call last):
  File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/ta_ms_loganalytics/modinput_wrapper/base_modinput.py", line 127, in stream_events
    self.collect_events(ew)
  File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py", line 96, in collect_events
    input_module.collect_events(self, ew)
  File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/input_module_log_analytics.py", line 86, in collect_events
    for i in range(len(data["tables"][0]["rows"])):
UnboundLocalError: local variable 'data' referenced before assignment
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Jun 2019 16:00:17 GMT</pubDate>
    <dc:creator>jaxjohnny2000</dc:creator>
    <dc:date>2019-06-28T16:00:17Z</dc:date>
    <item>
      <title>Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452066#M55583</link>
      <description>&lt;P&gt;Fellow OMS Splunkers, what do you think about these messages?  &lt;/P&gt;

&lt;P&gt;Using:  &lt;CODE&gt;Type=SecurityBaseline AnalyzeResult=Failed&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;06-28-2019 15:57:21.704 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" ERRORlocal variable 'data' referenced before assignment


06-28-2019 15:57:21.677 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" UnboundLocalError: local variable 'data' referenced before assignment

06-28-2019 15:57:21.677 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"     for i in range(len(data["tables"][0]["rows"])):
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using: AzureActivity  | summarize count() by Category&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-06-28 15:58:54,518 ERROR pid=130483 tid=MainThread file=base_modinput.py:log_error:307 | Get error when collecting events.
Traceback (most recent call last):
  File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/ta_ms_loganalytics/modinput_wrapper/base_modinput.py", line 127, in stream_events
    self.collect_events(ew)
  File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py", line 96, in collect_events
    input_module.collect_events(self, ew)
  File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/input_module_log_analytics.py", line 86, in collect_events
    for i in range(len(data["tables"][0]["rows"])):
UnboundLocalError: local variable 'data' referenced before assignment
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Jun 2019 16:00:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452066#M55583</guid>
      <dc:creator>jaxjohnny2000</dc:creator>
      <dc:date>2019-06-28T16:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452067#M55584</link>
      <description>&lt;P&gt;More errors to help.&lt;/P&gt;

&lt;P&gt;2019-06-28 16:30:36,740 DEBUG pid=24441 tid=MainThread file=connectionpool.py:_make_request:400 | &lt;A href="https://api.loganalytics.io:443" target="_blank"&gt;https://api.loganalytics.io:443&lt;/A&gt; "POST /v1/workspaces/PRD001OMSLogAnalytics/query HTTP/1.1" 404 84&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:08:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452067#M55584</guid>
      <dc:creator>jaxjohnny2000</dc:creator>
      <dc:date>2020-09-30T01:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452068#M55585</link>
      <description>&lt;P&gt;UnboundLocalError: local variable 'data' referenced before assignment&lt;/P&gt;

&lt;P&gt;ERRORlocal variable 'data' referenced before assignment&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 20:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452068#M55585</guid>
      <dc:creator>jaxjohnny2000</dc:creator>
      <dc:date>2019-07-02T20:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452069#M55586</link>
      <description>&lt;P&gt;Read how @Esky73 solved the problem using legacy OMS query language here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/700795/v103-seeing-a-get-error-when-collecting-events.html"&gt;https://answers.splunk.com/answers/700795/v103-seeing-a-get-error-when-collecting-events.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 13:53:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452069#M55586</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-11T13:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452070#M55587</link>
      <description>&lt;P&gt;You're  getting a 404 not found on the post to the API&lt;/P&gt;

&lt;P&gt;Try changing your config so that this &lt;/P&gt;

&lt;P&gt;SPZE2HSTPRD001OMSLogAnalytics&lt;/P&gt;

&lt;P&gt;Is the GUID for the workspace instead of the name.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 17:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452070#M55587</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-11T17:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452071#M55588</link>
      <description>&lt;P&gt;This was the answer!  use the Workspace ID GUID to retrieve data!!!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 20:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452071#M55588</guid>
      <dc:creator>jaxjohnny2000</dc:creator>
      <dc:date>2019-07-11T20:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452072#M55589</link>
      <description>&lt;P&gt;I think it works this way for some and then the other way for others because I had it working with the GUID in my env and someone else said it should be the name and that's how they got it working, so then I updated the code to ask for the name and now it seems to want the ID for you... oh well now we know!&lt;/P&gt;

&lt;P&gt;Thanks for checking!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 00:33:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452072#M55589</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-12T00:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452073#M55590</link>
      <description>&lt;P&gt;Please leave me a review on LinkedIn if this app made your life easier &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 00:36:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452073#M55590</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-12T00:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452074#M55591</link>
      <description>&lt;P&gt;Good idea turning on debug!  That got us to the solution!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 00:37:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/452074#M55591</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-12T00:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Local variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/531836#M64361</link>
      <description>&lt;P&gt;In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a value anywhere within the function’s body, it’s assumed to be a local unless explicitly declared as global. The unboundlocalerror: local variable referenced &lt;A href="http://net-informations.com/python/err/local.htm" target="_self"&gt;before assignment&lt;/A&gt; is raised when you try to use a variable before it has been assigned in the local context. All variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the global symbol table, and then in the table of built-in names. Thus, global variables cannot be directly assigned a value within a function (unless named in a global statement), although they may be referenced.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 09:31:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Local-variable-data-referenced-before-assignment/m-p/531836#M64361</guid>
      <dc:creator>fillermark</dc:creator>
      <dc:date>2020-12-03T09:31:18Z</dc:date>
    </item>
  </channel>
</rss>

