<?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 Splunk Add-on for Microsoft Office 365 Graph API and CAS input does not work on Windows? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Add-on-for-Microsoft-Office-365-Graph-API-and-CAS-input/m-p/583521#M76026</link>
    <description>&lt;P&gt;I am trying to collect data from Azure&amp;nbsp;Graph, and CAS API using the&amp;nbsp;Splunk Add-on for Microsoft Office 365 app. I tried this first on a windows server and got this error:&lt;/P&gt;
&lt;P&gt;2022-02-03 11:34:12,218 level=INFO pid=7340 tid=MainThread logger=splunksdc.collector pos=collector.py:run:251 | | message="Modular input started."&lt;BR /&gt;2022-02-03 11:34:12,508 level=INFO pid=7340 tid=MainThread logger=splunk_ta_o365.common.settings pos=settings.py:load:36 | datainput=b'testsignins' start_time=1643884452 | message="Load proxy settings success." enabled=False host=b'' port=b'' username=b''&lt;BR /&gt;2022-02-03 11:34:12,802 level=INFO pid=7340 tid=MainThread logger=splunk_ta_o365.common.portal pos=portal.py:get_v2_token_by_psk:160 | datainput=b'testsignins' start_time=1643884452 | message="Acquire access token success." expires_on=1643888051.8024929&lt;BR /&gt;2022-02-03 11:34:13,806 level=DEBUG pid=7340 tid=MainThread logger=splunk_ta_o365.modinputs.graph_api pos=graph_api.py:run:102 | datainput=b'testsignins' start_time=1643884452 | message="Start Retrieving Graph Api Audit Messages." timestamp=1643884453.8066385 report=b'signIns'&lt;BR /&gt;2022-02-03 11:34:13,806 level=INFO pid=7340 tid=MainThread logger=splunk_ta_o365.common.portal pos=portal.py:get:462 | datainput=b'testsignins' start_time=1643884452 | message="Calling Microsoft Graph API." url=b'&lt;A href="https://graph.microsoft.com/v1.0/auditLogs/signIns" target="_blank" rel="noopener"&gt;https://graph.microsoft.com/v1.0/auditLogs/signIns&lt;/A&gt;' params=None&lt;BR /&gt;2022-02-03 11:34:21,628 level=ERROR pid=7340 tid=MainThread logger=splunk_ta_o365.modinputs.graph_api pos=graph_api.py:run:118 | datainput=b'testsignins' start_time=1643884452 | message="Error retrieving Cloud Application Security messages." exception=Invalid format string&lt;BR /&gt;2022-02-03 11:34:21,628 level=ERROR pid=7340 tid=MainThread logger=splunk_ta_o365.modinputs.graph_api pos=utils.py:wrapper:72 | datainput=b'testsignins' start_time=1643884452 | message="Data input was interrupted by an unhandled exception."&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunksdc\utils.py", line 70, in wrapper&lt;BR /&gt;return func(*args, **kwargs)&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunk_ta_o365\modinputs\graph_api.py", line 235, in run&lt;BR /&gt;return consumer.run()&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunk_ta_o365\modinputs\graph_api.py", line 114, in run&lt;BR /&gt;self._ingest(message, source)&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunk_ta_o365\modinputs\graph_api.py", line 125, in _ingest&lt;BR /&gt;expiration = int(message.update_time.strftime('%s'))&lt;BR /&gt;ValueError: Invalid format string&lt;BR /&gt;2022-02-03 11:34:21,632 level=INFO pid=7340 tid=MainThread logger=splunksdc.collector pos=collector.py:run:254 | | message="Modular input exited."&lt;/P&gt;
&lt;P&gt;Authenication seems to be working but it looks like it returns an unexpected string value it can't handle. I tested the azure app and CAS token using powershell and no issues. So last ditch effort was to try on another server. This happend to be a Linux server. When i set the app up there everything worked without issues. This made me think that the Graph and CAS inputs does not work on Windows servers since this was the only difference.&amp;nbsp; So i tested on an another windows server and got the same error. So I wondered if anyone else here has the same result as me, or has managed to get this running on a windows server? The app in splunk says it is platform independent, so it should run on windows to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2023 19:47:37 GMT</pubDate>
    <dc:creator>melvinfuglem</dc:creator>
    <dc:date>2023-02-09T19:47:37Z</dc:date>
    <item>
      <title>Splunk Add-on for Microsoft Office 365 Graph API and CAS input does not work on Windows?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Add-on-for-Microsoft-Office-365-Graph-API-and-CAS-input/m-p/583521#M76026</link>
      <description>&lt;P&gt;I am trying to collect data from Azure&amp;nbsp;Graph, and CAS API using the&amp;nbsp;Splunk Add-on for Microsoft Office 365 app. I tried this first on a windows server and got this error:&lt;/P&gt;
&lt;P&gt;2022-02-03 11:34:12,218 level=INFO pid=7340 tid=MainThread logger=splunksdc.collector pos=collector.py:run:251 | | message="Modular input started."&lt;BR /&gt;2022-02-03 11:34:12,508 level=INFO pid=7340 tid=MainThread logger=splunk_ta_o365.common.settings pos=settings.py:load:36 | datainput=b'testsignins' start_time=1643884452 | message="Load proxy settings success." enabled=False host=b'' port=b'' username=b''&lt;BR /&gt;2022-02-03 11:34:12,802 level=INFO pid=7340 tid=MainThread logger=splunk_ta_o365.common.portal pos=portal.py:get_v2_token_by_psk:160 | datainput=b'testsignins' start_time=1643884452 | message="Acquire access token success." expires_on=1643888051.8024929&lt;BR /&gt;2022-02-03 11:34:13,806 level=DEBUG pid=7340 tid=MainThread logger=splunk_ta_o365.modinputs.graph_api pos=graph_api.py:run:102 | datainput=b'testsignins' start_time=1643884452 | message="Start Retrieving Graph Api Audit Messages." timestamp=1643884453.8066385 report=b'signIns'&lt;BR /&gt;2022-02-03 11:34:13,806 level=INFO pid=7340 tid=MainThread logger=splunk_ta_o365.common.portal pos=portal.py:get:462 | datainput=b'testsignins' start_time=1643884452 | message="Calling Microsoft Graph API." url=b'&lt;A href="https://graph.microsoft.com/v1.0/auditLogs/signIns" target="_blank" rel="noopener"&gt;https://graph.microsoft.com/v1.0/auditLogs/signIns&lt;/A&gt;' params=None&lt;BR /&gt;2022-02-03 11:34:21,628 level=ERROR pid=7340 tid=MainThread logger=splunk_ta_o365.modinputs.graph_api pos=graph_api.py:run:118 | datainput=b'testsignins' start_time=1643884452 | message="Error retrieving Cloud Application Security messages." exception=Invalid format string&lt;BR /&gt;2022-02-03 11:34:21,628 level=ERROR pid=7340 tid=MainThread logger=splunk_ta_o365.modinputs.graph_api pos=utils.py:wrapper:72 | datainput=b'testsignins' start_time=1643884452 | message="Data input was interrupted by an unhandled exception."&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunksdc\utils.py", line 70, in wrapper&lt;BR /&gt;return func(*args, **kwargs)&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunk_ta_o365\modinputs\graph_api.py", line 235, in run&lt;BR /&gt;return consumer.run()&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunk_ta_o365\modinputs\graph_api.py", line 114, in run&lt;BR /&gt;self._ingest(message, source)&lt;BR /&gt;File "C:\Program Files\Splunk\etc\apps\splunk_ta_o365\bin\splunk_ta_o365\modinputs\graph_api.py", line 125, in _ingest&lt;BR /&gt;expiration = int(message.update_time.strftime('%s'))&lt;BR /&gt;ValueError: Invalid format string&lt;BR /&gt;2022-02-03 11:34:21,632 level=INFO pid=7340 tid=MainThread logger=splunksdc.collector pos=collector.py:run:254 | | message="Modular input exited."&lt;/P&gt;
&lt;P&gt;Authenication seems to be working but it looks like it returns an unexpected string value it can't handle. I tested the azure app and CAS token using powershell and no issues. So last ditch effort was to try on another server. This happend to be a Linux server. When i set the app up there everything worked without issues. This made me think that the Graph and CAS inputs does not work on Windows servers since this was the only difference.&amp;nbsp; So i tested on an another windows server and got the same error. So I wondered if anyone else here has the same result as me, or has managed to get this running on a windows server? The app in splunk says it is platform independent, so it should run on windows to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 19:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Add-on-for-Microsoft-Office-365-Graph-API-and-CAS-input/m-p/583521#M76026</guid>
      <dc:creator>melvinfuglem</dc:creator>
      <dc:date>2023-02-09T19:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Add-on for Microsoft Office 365 Graph API and CAS input does not work on Windows</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Add-on-for-Microsoft-Office-365-Graph-API-and-CAS-input/m-p/630349#M78481</link>
      <description>&lt;P&gt;That is a portability bug in the Python code of the add-on.&lt;/P&gt;&lt;P&gt;The right way to proceed is to seek updates for this add-on, and if you are already at the latest version, file a Splunk support ticket with the below information, since the add-on is Splunk Supported.&lt;/P&gt;&lt;P&gt;Details of the problem:&lt;/P&gt;&lt;P&gt;The format codes you can pass to a Python datetime object's strftime method (that "work on all platforms with a standard C implementation") are documented at &lt;A href="https://docs.python.org/3/library/datetime.html?highlight=strftime#strftime-strptime-behavior" target="_self"&gt;https://docs.python.org/3/library/datetime.html?highlight=strftime#strftime-strptime-behavior&lt;/A&gt;. %s is not one of them. It's a GNU extension to the C89 standard (compare the Python docs with &lt;A href="https://manpage.me/index.cgi?apropos=0&amp;amp;q=strftime&amp;amp;sektion=3&amp;amp;manpath=Debian+8.1.0&amp;amp;arch=default&amp;amp;format=html" target="_self"&gt;strftime(3) from Debian 8.1.0&lt;/A&gt;). This means %s can be used where Python is built on top of the GNU C library (e.g. Red Hat Enterprise Linux), but cannot be used elsewhere (e.g., Windows). That's why the exception "Invalid format string" was raised.&lt;/P&gt;&lt;P&gt;%s is supposed to produce the number of seconds since 1970-01-01 00:00:00 +0000 (UTC). Python datetime objects can do this using their &lt;A href="https://docs.python.org/3/library/datetime.html?highlight=strftime#datetime.datetime.timestamp" target="_self"&gt;timestamp&lt;/A&gt; method, which appears to be equally available on all platforms.&lt;/P&gt;&lt;P&gt;So, line 125 of splunk_ta_o365/bin/splunk_ta_o365/modinputs/graph_api.py should perhaps say:&lt;/P&gt;&lt;PRE&gt;expiration = int(message.update_time.timestamp())&lt;/PRE&gt;&lt;P&gt;Some additional code may be necessary to treat timezones properly.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 18:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-Add-on-for-Microsoft-Office-365-Graph-API-and-CAS-input/m-p/630349#M78481</guid>
      <dc:creator>jaredjennings</dc:creator>
      <dc:date>2023-02-09T18:59:52Z</dc:date>
    </item>
  </channel>
</rss>

