<?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: difficulty in updating a lookup file via rest in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344764#M102141</link>
    <description>&lt;P&gt;If you're creating a new lookup file, you need to POST to &lt;CODE&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files&lt;/A&gt;&lt;/CODE&gt; and include &lt;CODE&gt;name&lt;/CODE&gt; in your data.  You POST to &lt;CODE&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files/&amp;lt;name&amp;gt;" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files/&amp;lt;name&amp;gt;&lt;/A&gt;;&lt;/CODE&gt; if you're replacing an existing lookup file.&lt;/P&gt;

&lt;P&gt;Try POSTing to &lt;CODE&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files&lt;/A&gt;&lt;/CODE&gt; and see if that helps.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2018 21:49:01 GMT</pubDate>
    <dc:creator>micahkemp</dc:creator>
    <dc:date>2018-02-05T21:49:01Z</dc:date>
    <item>
      <title>difficulty in updating a lookup file via rest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344761#M102138</link>
      <description>&lt;P&gt;i have a script that generates a csv under /var/run/splunk&lt;/P&gt;

&lt;P&gt;I would like to update my lookup file&lt;/P&gt;

&lt;P&gt;I read the docs and it says to post a request like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;response = requests.post('https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv', data=payload, verify=False, headers=headers)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where headers are like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;headers={'Authorization': 'Splunk xXxXxXXXxXXXy','Content-Type': 'application/json'}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and the data is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{'eai:data': '/opt/splunk/var/run/splunk/cve.csv'}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i can read that endpoint like (excerpt):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;entry&amp;gt;
    &amp;lt;title&amp;gt;cve.csv&amp;lt;/title&amp;gt;
    &amp;lt;id&amp;gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv&amp;lt;/id&amp;gt;
    &amp;lt;updated&amp;gt;2018-02-02T15:57:56+01:00&amp;lt;/updated&amp;gt;
    &amp;lt;link href="/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv" rel="alternate"/&amp;gt;
    &amp;lt;author&amp;gt;
      &amp;lt;name&amp;gt;nobody&amp;lt;/name&amp;gt;
    &amp;lt;/author&amp;gt;
    &amp;lt;link href="/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv" rel="list"/&amp;gt;
    &amp;lt;link href="/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv/_reload" rel="_reload"/&amp;gt;
    &amp;lt;link href="/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv" rel="edit"/&amp;gt;
    &amp;lt;link href="/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv" rel="remove"/&amp;gt;
    &amp;lt;link href="/servicesNS/nobody/SA-cve/data/lookup-table-files/cve.csv/move" rel="move"/&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and it looks ok but post failes with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; print response
&amp;lt;Response [500]&amp;gt;
&amp;gt;&amp;gt;&amp;gt; print response.text
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="ERROR"&amp;gt;
 In handler 'lookup-table-files': Data could not be written: /nobody/SA-cve/lookups/cve.csv: /opt/splunk/var/run/splunk/cve.cvs&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 16:38:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344761#M102138</guid>
      <dc:creator>dominiquevocat</dc:creator>
      <dc:date>2018-02-02T16:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty in updating a lookup file via rest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344762#M102139</link>
      <description>&lt;P&gt;The response you included in your question shows &lt;CODE&gt;cve.cvs&lt;/CODE&gt; for the filename, but your &lt;CODE&gt;eai:data&lt;/CODE&gt; snippet suggests you mean &lt;CODE&gt;cve.csv&lt;/CODE&gt;.  Is there any chance you have a typo in your script somewhere?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 01:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344762#M102139</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-04T01:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty in updating a lookup file via rest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344763#M102140</link>
      <description>&lt;P&gt;hi, must be a typo when doing the ticket&lt;/P&gt;

&lt;P&gt;I just tried again just in case &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; hope springs eternal but it was a typo&lt;/P&gt;

&lt;P&gt;The lookup file is shared globaly&lt;BR /&gt;
/opt/splunk/etc/apps/SA-cve/lookups/cve.csv |   No owner |  SA-cve | Global&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 17:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344763#M102140</guid>
      <dc:creator>dominiquevocat</dc:creator>
      <dc:date>2018-02-05T17:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: difficulty in updating a lookup file via rest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344764#M102141</link>
      <description>&lt;P&gt;If you're creating a new lookup file, you need to POST to &lt;CODE&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files&lt;/A&gt;&lt;/CODE&gt; and include &lt;CODE&gt;name&lt;/CODE&gt; in your data.  You POST to &lt;CODE&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files/&amp;lt;name&amp;gt;" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files/&amp;lt;name&amp;gt;&lt;/A&gt;;&lt;/CODE&gt; if you're replacing an existing lookup file.&lt;/P&gt;

&lt;P&gt;Try POSTing to &lt;CODE&gt;&lt;A href="https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/SA-cve/data/lookup-table-files&lt;/A&gt;&lt;/CODE&gt; and see if that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 21:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/difficulty-in-updating-a-lookup-file-via-rest/m-p/344764#M102141</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2018-02-05T21:49:01Z</dc:date>
    </item>
  </channel>
</rss>

