<?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: Using Lookup in Python SDK in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697117#M11674</link>
    <description>&lt;P&gt;Have you tried using a kv store instead of csv as I know that csv lookup don't work for python custom commands?&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2024 07:39:02 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-08-23T07:39:02Z</dc:date>
    <item>
      <title>Using Lookup in Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697072#M11673</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a query -&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;searchquery_oneshot = "search (index=__* ... events{}.name=ResourceCreated) | dedup \"events{}.tags.A\" | spath \"events{}.tags.A\" || lookup Map.csv \"B\" OUTPUT \"D\" | table ... | collect ...&lt;/LI-CODE&gt;
&lt;P&gt;I ran this using Python SDK in VSCode as -&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;oneshotsearch_results = service.jobs.oneshot(searchquery_oneshot, **kwargs_oneshot)
conn.cursor().execute(sql, val)&lt;/LI-CODE&gt;
&lt;P&gt;I ran the above using psycopg2 and got this error-&lt;BR /&gt;FATAL: Error in 'lookup' command: Could not construct lookup 'Map.csv, B, OUTPUT, D'. See search.log for more details.&lt;/P&gt;
&lt;P&gt;The above query works when run inside splunk enterprise i.e. map.csv is looked-up and result fetched correctly.&lt;BR /&gt;How do I locate my search.log? It is&amp;nbsp;&amp;nbsp;splunkhome/var/lib/dispatch/run I assume. What is the error above?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 16:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697072#M11673</guid>
      <dc:creator>MK3</dc:creator>
      <dc:date>2024-08-22T16:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup in Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697117#M11674</link>
      <description>&lt;P&gt;Have you tried using a kv store instead of csv as I know that csv lookup don't work for python custom commands?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 07:39:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697117#M11674</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-23T07:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using Lookup in Python SDK</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697209#M11677</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/271174"&gt;@MK3&lt;/a&gt;- I believe its an permission and/or app-context issue.&lt;/P&gt;&lt;P&gt;When you create &lt;STRONG&gt;service&lt;/STRONG&gt; object,&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Provide the same username you use to login on Splunk UI&lt;/LI&gt;&lt;LI&gt;Provide the same App name which you use on UI and search works fine&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;service = client.connect(host="&amp;lt;ip/hostname&amp;gt;", username="&amp;lt;username&amp;gt;", password="&amp;lt;user-passwd", app="&amp;lt;same app as you use on UI&amp;gt;")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2024 05:14:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Using-Lookup-in-Python-SDK/m-p/697209#M11677</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2024-08-25T05:14:21Z</dc:date>
    </item>
  </channel>
</rss>

