<?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 TA for MS log analytics is throwing errors in the python script when trying to collect data from the Azure logs.  ERRORlocal variable 'data' referenced before assignment in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400581#M48858</link>
    <description>&lt;P&gt;I get the following errors when try to collect events using the log analytics add on against azure.  the query I use in the input is:&lt;BR /&gt;
Log Analytics Query&lt;BR /&gt;
AzureActivity | search *&lt;BR /&gt;
and the query works if I run it in the workspace.  any ideas?&lt;/P&gt;

&lt;P&gt;07-18-2019 16:45:05.078 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" ERRORlocal variable 'data' referenced before assignment&lt;BR /&gt;
07-18-2019 16:45:05.045 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" UnboundLocalError: local variable 'data' referenced before assignment&lt;BR /&gt;
07-18-2019 16:45:05.045 +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;BR /&gt;
07-18-2019 16:45:05.045 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"   File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/input_module_log_analytics.py", line 86, in collect_events&lt;BR /&gt;
07-18-2019 16:45:05.045 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"     input_module.collect_events(self, ew)&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"   File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py", line 96, in collect_events&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"     self.collect_events(ew)&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"   File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/ta_ms_loganalytics/modinput_wrapper/base_modinput.py", line 127, in stream_events&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" Traceback (most recent call last):&lt;/P&gt;

&lt;P&gt;tagging &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/199197"&gt;@jkat54&lt;/a&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 01:24:54 GMT</pubDate>
    <dc:creator>jlstanley</dc:creator>
    <dc:date>2020-09-30T01:24:54Z</dc:date>
    <item>
      <title>TA for MS log analytics is throwing errors in the python script when trying to collect data from the Azure logs.  ERRORlocal variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400581#M48858</link>
      <description>&lt;P&gt;I get the following errors when try to collect events using the log analytics add on against azure.  the query I use in the input is:&lt;BR /&gt;
Log Analytics Query&lt;BR /&gt;
AzureActivity | search *&lt;BR /&gt;
and the query works if I run it in the workspace.  any ideas?&lt;/P&gt;

&lt;P&gt;07-18-2019 16:45:05.078 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" ERRORlocal variable 'data' referenced before assignment&lt;BR /&gt;
07-18-2019 16:45:05.045 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" UnboundLocalError: local variable 'data' referenced before assignment&lt;BR /&gt;
07-18-2019 16:45:05.045 +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;BR /&gt;
07-18-2019 16:45:05.045 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"   File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/input_module_log_analytics.py", line 86, in collect_events&lt;BR /&gt;
07-18-2019 16:45:05.045 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"     input_module.collect_events(self, ew)&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"   File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py", line 96, in collect_events&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"     self.collect_events(ew)&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py"   File "/opt/splunk/etc/apps/TA-ms-loganalytics/bin/ta_ms_loganalytics/modinput_wrapper/base_modinput.py", line 127, in stream_events&lt;BR /&gt;
07-18-2019 16:45:05.044 +0000 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/TA-ms-loganalytics/bin/log_analytics.py" Traceback (most recent call last):&lt;/P&gt;

&lt;P&gt;tagging &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/199197"&gt;@jkat54&lt;/a&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:24:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400581#M48858</guid>
      <dc:creator>jlstanley</dc:creator>
      <dc:date>2020-09-30T01:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: TA for MS log analytics is throwing errors in the python script when trying to collect data from the Azure logs.  ERRORlocal variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400582#M48859</link>
      <description>&lt;P&gt;Govcloud or not?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 19:09:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400582#M48859</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-07-18T19:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: TA for MS log analytics is throwing errors in the python script when trying to collect data from the Azure logs.  ERRORlocal variable 'data' referenced before assignment</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400583#M48860</link>
      <description>&lt;P&gt;No,  but literally 20 min after I posted this I found the log I should have been looking at and it says this:&lt;BR /&gt;
2019-07-18 18:04:53,241 ERROR pid=61422 tid=MainThread file=base_modinput.py:log_error:307 | OMSInputName="AzureActivityLogs" status="403" step="Post Query" response="{"error":{"message":"The provided credentials have insufficient access to perform the requested operation","code":"InsufficientAccessError"}}"&lt;BR /&gt;
so it's pretty obvious it's a perms issue at this point.  I'm waiting to hear back from the Azure group to fix it.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:25:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/TA-for-MS-log-analytics-is-throwing-errors-in-the-python-script/m-p/400583#M48860</guid>
      <dc:creator>jlstanley</dc:creator>
      <dc:date>2020-09-30T01:25:02Z</dc:date>
    </item>
  </channel>
</rss>

