<?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: 'outputlookup' command: Could not write to file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16615#M2239</link>
    <description>&lt;P&gt;Ran into this error today.  In my case, I had the CSV file open in Excel - causing a write lock.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2017 22:28:20 GMT</pubDate>
    <dc:creator>bharrell</dc:creator>
    <dc:date>2017-09-12T22:28:20Z</dc:date>
    <item>
      <title>'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16608#M2232</link>
      <description>&lt;P&gt;I'm trying to use &lt;CODE&gt;outputlookup&lt;/CODE&gt; to generate a lookup table based on search results and I'm running into the following error:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;Error in 'outputlookup' command: Could not write to file 'metrics_daily_sourcetype.csv'.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I've tried both both a simple csv file, an absolute path, as well as a named lookup (stanza name in  &lt;CODE&gt;transforms.conf&lt;/CODE&gt;).&lt;/P&gt;

&lt;P&gt;Then I looked in the &lt;CODE&gt;search.log&lt;/CODE&gt; for search job and found the following error messages:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;06-30-2010 17:24:09.122 ERROR SearchResults - Unable to write to file '/opt/splunk/etc/apps/SplunkAdmin/lookups/metrics_daily_sourcetype.csv'.  Retried 5 times, period=500 ms. error='Invalid cross-device link'
06-30-2010 17:24:09.122 ERROR outputcsv - Error in 'outputlookup' command: Could not write to file 'metrics_daily_sourcetype.csv'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; and &lt;CODE&gt;$SPLUNK_HOME/var/run&lt;/CODE&gt; are on a different file system.  And I'm wondering if that has anything to do with the issue.  (I ran into an issue with this before with summary indexing.  The stash file was written to a temp file under &lt;CODE&gt;$SPLUNK_HOME/var/run&lt;/CODE&gt; and the process assumed it could do a "rename" (which is atomic) rather than doing a move which is needed when you have multiple partitions.  So I'm wondering if something similar is going on here.)&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;I'm running Splunk 4.1.3 on Ubuntu Linux 8.04 (32 bit)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Workaround:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I'm temporarily working around this issue by using &lt;CODE&gt;outputcsv&lt;/CODE&gt; and then manually coping my file from &lt;CODE&gt;$SPLUNK_HOME/var/run/splunk/table.csv&lt;/CODE&gt; to &lt;CODE&gt;$SPLUNK_HOME/etc/apps/SplunkAdmin/lookups/&lt;/CODE&gt;.  But this is rather tedious.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2010 04:37:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16608#M2232</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-07-01T04:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16609#M2233</link>
      <description>&lt;P&gt;There is a open defect ticket on this -- not sure what the ticket number is but as I was troubleshooting a similar issue people in IRC noted that this is an open issue.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2010 04:51:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16609#M2233</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-07-01T04:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16610#M2234</link>
      <description>&lt;P&gt;ACtually found the defect in an email it's SPL-31130&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2010 04:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16610#M2234</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-07-01T04:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16611#M2235</link>
      <description>&lt;P&gt;This seems to be related to SPL-31130 -- output file located on a different file system.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2010 04:57:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16611#M2235</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-07-01T04:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16612#M2236</link>
      <description>&lt;P&gt;Thanks.  I've emailed support asking to be included on this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2010 05:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16612#M2236</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-07-01T05:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16613#M2237</link>
      <description>&lt;P&gt;were you able to fix the issue? If so, how did you do it?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2012 02:11:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16613#M2237</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2012-10-14T02:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16614#M2238</link>
      <description>&lt;P&gt;This issue should be fixed with Splunk version 4.1.4+&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 00:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16614#M2238</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2012-10-27T00:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: 'outputlookup' command: Could not write to file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16615#M2239</link>
      <description>&lt;P&gt;Ran into this error today.  In my case, I had the CSV file open in Excel - causing a write lock.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 22:28:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/outputlookup-command-Could-not-write-to-file/m-p/16615#M2239</guid>
      <dc:creator>bharrell</dc:creator>
      <dc:date>2017-09-12T22:28:20Z</dc:date>
    </item>
  </channel>
</rss>

