<?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: Need help getting data from Splunk REST API in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597787#M208161</link>
    <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.2.2202/Knowledge/Usefieldlookupstoaddinformationtoyourevents" target="_blank"&gt;Define a CSV lookup in Splunk Web - Splunk Documentation&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 May 2022 14:52:49 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-05-13T14:52:49Z</dc:date>
    <item>
      <title>How do I get data from Splunk REST API using python? Receiving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597694#M208102</link>
      <description>&lt;P&gt;Hi, so my team is currently has some data on Splunk cloud.&amp;nbsp; My task is to use your REST API to get this data using python.&lt;/P&gt;
&lt;P&gt;On Splunk web I get this data by using the following query:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;| from inputlookup:"cloud_accountList"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I have written a simple python script to get the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;splunkTenant = 'avc3'
splunkURL = {
    'api': f"https://ab1.{splunkTenant}.splunkcloud.com:1234",
}
splunkCredentials = {
    'user': 'test_user',
    'password': 'SplunkIsGreat'
}
searchString = f"| from inputlookup:\"cloud_accountList\""

search = {
    'search': searchString,
    'output_mode': 'json'
}

splunkEndpoints = {
    'returnedAppSearch': f"{splunkURL['api']}/servicesNS/{splunkCredentials['user'].upper()}",
}

cacertpath = '/Users/***/Downloads/cacert.pem'

searchURL2 = f"{splunkEndpoints['returnedAppSearch']}/APP_NAME/search/jobs"

splunk_response = requests.post(
    url=searchURL,
    auth=(str(splunkCredentials['user']), str(splunkCredentials['password'])),
    verify=cacertpath
    data=search)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run this script I get an error.&amp;nbsp; Can someone please help me out?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 20:47:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597694#M208102</guid>
      <dc:creator>ssharm223</dc:creator>
      <dc:date>2022-05-16T20:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting data from Splunk REST API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597737#M208136</link>
      <description>&lt;P&gt;What error do you get?&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 07:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597737#M208136</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-13T07:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting data from Splunk REST API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597773#M208157</link>
      <description>&lt;LI-CODE lang="markup"&gt;'ERROR', 'text': "The lookup table 'cloud_accountList' requires a .csv or KV store lookup definition&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error I am getting&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597773#M208157</guid>
      <dc:creator>ssharm223</dc:creator>
      <dc:date>2022-05-13T14:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting data from Splunk REST API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597777#M208159</link>
      <description>&lt;P&gt;Looks like you need to set up a definition for the lookup&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1652452352271.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19630i2B0551CD3E6BEEC0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1652452352271.png" alt="ITWhisperer_0-1652452352271.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597777#M208159</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-13T14:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting data from Splunk REST API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597786#M208160</link>
      <description>&lt;P&gt;Thanks ITWhisperer.&amp;nbsp; Can you list the exact steps we have to follow?&amp;nbsp; I am very new to this.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:49:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597786#M208160</guid>
      <dc:creator>ssharm223</dc:creator>
      <dc:date>2022-05-13T14:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting data from Splunk REST API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597787#M208161</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.2.2202/Knowledge/Usefieldlookupstoaddinformationtoyourevents" target="_blank"&gt;Define a CSV lookup in Splunk Web - Splunk Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/597787#M208161</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-13T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help getting data from Splunk REST API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/598002#M208234</link>
      <description>&lt;P&gt;Went over this with an admin.&amp;nbsp; Looks like the lookup is already defined.&amp;nbsp; Is there anything else I can try?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 20:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/598002#M208234</guid>
      <dc:creator>ssharm223</dc:creator>
      <dc:date>2022-05-16T20:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get data from Splunk REST API using python? Receiving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/655930#M226538</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245768"&gt;@ssharm223&lt;/a&gt;&amp;nbsp;did you ever get an answer to this? Guessing no? I'm having the same issue with accessing a csv lookup that I can access via the web UI, however attempting to access it via API gets me:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Non-result: ERROR The lookup table 'asset_lookup-by_str' requires a .csv or KV store lookup definition..&lt;/LI-CODE&gt;&lt;P&gt;However changing the search to "|inputlookup asset_lookup-by_str.csv" still gets me:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; Non-result: ERROR The lookup table 'asset_lookup-by_str.csv' requires a .csv or KV store lookup definition..&lt;/LI-CODE&gt;&lt;P&gt;I suspect there is some combination of non-filesystem access and non-default csv locations that means we are SOL, but &lt;STRONG&gt;happy&lt;/STRONG&gt; to be proven wrong by the brains trust!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 08:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/655930#M226538</guid>
      <dc:creator>AGLbwa</dc:creator>
      <dc:date>2023-08-29T08:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get data from Splunk REST API using python? Receiving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/655931#M226539</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245768"&gt;@ssharm223&lt;/a&gt;&amp;nbsp;One thing that may be worth trying is adding the app to your connection parameters. I get a different error when I do this and it may simply be that my permissions aren't set up correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 08:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/655931#M226539</guid>
      <dc:creator>AGLbwa</dc:creator>
      <dc:date>2023-08-29T08:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get data from Splunk REST API using python? Receiving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/656034#M226575</link>
      <description>&lt;P&gt;This was me with a typo - see that dash? It should be an underscore (and the lookup was kvstore, not csv)!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 00:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/656034#M226575</guid>
      <dc:creator>AGLbwa</dc:creator>
      <dc:date>2023-08-30T00:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get data from Splunk REST API using python? Receiving error</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/656748#M226829</link>
      <description>&lt;P&gt;Just as a follow up with csv I definitely get an error. I get the error:&lt;/P&gt;&lt;P&gt;Non-result: ERROR The lookup table 'not_really_my_lookup_name.csv' requires a .csv or KV store lookup definition..&lt;/P&gt;&lt;P&gt;Without .csv I get the same error but *also*:&lt;/P&gt;&lt;P&gt;Non-result: ERROR The lookup table 'not_really_my_lookup_name' is invalid..&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 04:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-data-from-Splunk-REST-API-using-python-Receiving/m-p/656748#M226829</guid>
      <dc:creator>AGLbwa</dc:creator>
      <dc:date>2023-09-06T04:26:52Z</dc:date>
    </item>
  </channel>
</rss>

