<?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: how to get splunk event logs by using rest api in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603923#M1578</link>
    <description>&lt;P&gt;Thanks for your quick response. I have tried same just I have replaced the my URL and credentials but im getting the this below json response&amp;nbsp;&lt;/P&gt;&lt;P&gt;My request:&lt;/P&gt;&lt;P&gt;curl -u test:test -k&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://test:8088/services/search/jobs" target="_blank" rel="nofollow noopener noreferrer"&gt;https://test:8088/services/search/jobs&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;-d search="search *"&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"text": "The requested URL was not found on this server.",&lt;BR /&gt;"code": 404&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2022 09:46:24 GMT</pubDate>
    <dc:creator>tcsec2user</dc:creator>
    <dc:date>2022-06-30T09:46:24Z</dc:date>
    <item>
      <title>How to get splunk event logs by using rest api?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603912#M1575</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I'm using Splunk cloud&amp;nbsp; REST API "&lt;SPAN&gt;/services/collector/event"&amp;nbsp; used to post the data to Splunk cloud .what is the Get API for fetch the data ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 13:23:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603912#M1575</guid>
      <dc:creator>tcsec2user</dc:creator>
      <dc:date>2022-06-30T13:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603914#M1576</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247342"&gt;@tcsec2user&lt;/a&gt;&amp;nbsp;- To fetch the data you need to execute the SPL search query through REST api.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/RESTREF/RESTsearch" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.0/RESTTUT/RESTsearches&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First you need to post the search job&lt;UL&gt;&lt;LI&gt;&lt;PRE&gt;curl -u admin:changeme -k https://localhost:8089/services/search/jobs -d search="search *"&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Then you need to check it's status&lt;UL&gt;&lt;LI&gt;&lt;PRE&gt;curl -u admin:changeme -k &lt;A href="https://localhost:8089/services/search/jobs/1258421375.19" target="_blank"&gt;https://localhost:8089/services/search/jobs/1258421375.19 &lt;/A&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Once successful you can retrieve the results&lt;UL&gt;&lt;LI&gt;&lt;PRE&gt;curl -u admin:changeme \
     -k https://localhost:8089/services/search/jobs/1258421375.19/results/ \
     --get -d output_mode=csv&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can also use Python Splunk SDK for this. -&amp;nbsp;&lt;A href="https://dev.splunk.com/view/python-sdk/SP-CAAAEBB" target="_blank"&gt;https://dev.splunk.com/view/python-sdk/SP-CAAAEBB&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603914#M1576</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-30T09:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603922#M1577</link>
      <description>&lt;P&gt;Thanks for your quick response. I have tried same just I have replaced the my URL and credentials but im getting the this below json response&amp;nbsp;&lt;/P&gt;&lt;P&gt;My request:&lt;/P&gt;&lt;P&gt;curl -u test:test -k &lt;A href="https://test:8088/services/search/jobs" target="_blank"&gt;https://test:8088/services/search/jobs&lt;/A&gt; -d search="search *"&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"text": "The requested URL was not found on this server.",&lt;BR /&gt;"code": 404&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603922#M1577</guid>
      <dc:creator>tcsec2user</dc:creator>
      <dc:date>2022-06-30T09:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603923#M1578</link>
      <description>&lt;P&gt;Thanks for your quick response. I have tried same just I have replaced the my URL and credentials but im getting the this below json response&amp;nbsp;&lt;/P&gt;&lt;P&gt;My request:&lt;/P&gt;&lt;P&gt;curl -u test:test -k&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://test:8088/services/search/jobs" target="_blank" rel="nofollow noopener noreferrer"&gt;https://test:8088/services/search/jobs&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;-d search="search *"&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"text": "The requested URL was not found on this server.",&lt;BR /&gt;"code": 404&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:46:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603923#M1578</guid>
      <dc:creator>tcsec2user</dc:creator>
      <dc:date>2022-06-30T09:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603926#M1579</link>
      <description>&lt;P&gt;Look at the port number it should be &lt;STRONG&gt;8089&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;8088 is the HEC port.&lt;/P&gt;&lt;P&gt;8089 is a management port.&lt;/P&gt;&lt;P&gt;(Though I'm not sure if management port on Splunk cloud would be publicly available or not.)&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603926#M1579</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-30T09:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603929#M1580</link>
      <description>&lt;P&gt;I changed and tried different ports numbers and in my global setting is the port number is &lt;STRONG&gt;8088&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603929#M1580</guid>
      <dc:creator>tcsec2user</dc:creator>
      <dc:date>2022-06-30T09:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603931#M1581</link>
      <description>&lt;P&gt;8088 != 8089 &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603931#M1581</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-06-30T09:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603932#M1582</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247342"&gt;@tcsec2user&lt;/a&gt;&amp;nbsp;&amp;nbsp;HEC is totally different than REST API.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;REST API is on 8089 (management port)&lt;/LI&gt;&lt;LI&gt;HEC is on 8088 port.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603932#M1582</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-30T09:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603934#M1583</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 10:00:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603934#M1583</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-30T10:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603940#M1584</link>
      <description>&lt;P&gt;8089 is also not working.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 10:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603940#M1584</guid>
      <dc:creator>tcsec2user</dc:creator>
      <dc:date>2022-06-30T10:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603941#M1585</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247342"&gt;@tcsec2user&lt;/a&gt;&amp;nbsp;- What error you are getting with that?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 10:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603941#M1585</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-30T10:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603945#M1586</link>
      <description>&lt;P&gt;Im using&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;HEC&lt;/STRONG&gt;&amp;nbsp; method .I post the data to Splunk&amp;nbsp;cloud using this URL&amp;nbsp;&lt;A href="https://localhost:8088/services/collector/event" target="_blank"&gt;https://localhost:8088/services/collector/event&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;then I want fetch that event data ?&lt;/P&gt;&lt;P&gt;I'm using token for authentications not using&amp;nbsp; my username and password .&lt;/P&gt;&lt;P&gt;if I use &lt;EM&gt;&lt;STRONG&gt;8089&lt;/STRONG&gt; as my port number it is not connected to server&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;using &lt;STRONG&gt;8088&lt;/STRONG&gt; &lt;A href="https://localhost:8088/services/search/jobs?search=" target="_blank"&gt;https://localhost:8088/services/search/jobs?search=&lt;/A&gt;"search *"&lt;/P&gt;&lt;P&gt;the response is&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"text":&amp;nbsp;"The&amp;nbsp;requested&amp;nbsp;URL&amp;nbsp;was&amp;nbsp;not&amp;nbsp;found&amp;nbsp;on&amp;nbsp;this&amp;nbsp;server.",&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"code":&amp;nbsp;404&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 10:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603945#M1586</guid>
      <dc:creator>tcsec2user</dc:creator>
      <dc:date>2022-06-30T10:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to get splunk event logs by using rest api</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603949#M1587</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247342"&gt;@tcsec2user&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The first call is for HEC which you are doing is correct.&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;I post the data to Splunk&amp;nbsp;cloud using this URL&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://localhost:8088/services/collector/event" target="_blank" rel="nofollow noopener noreferrer"&gt;https://localhost:8088/services/collector/event&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Then you do a search with the management port:&lt;UL&gt;&lt;LI&gt;&lt;A href="https://localhost:8088/services/search/jobs?search=" target="_blank"&gt;https://localhost:8088/services/search/jobs?search=&lt;/A&gt;"search *"&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Two things need to be corrected here&lt;/STRONG&gt;:&lt;UL&gt;&lt;LI&gt;Port needs to be &lt;STRONG&gt;8089&lt;/STRONG&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;You said "if I use 8089 as my port number it is not connected to server"&lt;/LI&gt;&lt;LI&gt;This could be due to the management p&lt;STRONG&gt;ort could be blocked for outside use on the Splunk cloud&lt;/STRONG&gt;. I'm not 100% sure. Please check with &lt;STRONG&gt;Splunk Cloud support&lt;/STRONG&gt; that I need to use the management port for REST API.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Second, "search="search *" is not a param so you need to make a post request and send it as the&lt;STRONG&gt; body.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So start with access to the management port on your Splunk cloud environment, and reach out to Splunk cloud support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 10:57:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-get-splunk-event-logs-by-using-rest-api/m-p/603949#M1587</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-06-30T10:57:26Z</dc:date>
    </item>
  </channel>
</rss>

