<?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: Monitor is not working with Python-generated .csv in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Monitor-is-not-working-with-Python-generated-csv/m-p/465607#M80251</link>
    <description>&lt;P&gt;Thanks to @micahkemp and @dwaddle for their assistance here. I posted this question to document the solution for the Splunk community.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;micah:fez:  2:34 PM
if that file ever looks like it's less than 256 bytes, say right after it's re-created, but before it's written with the exact same content
2:35
splunk might be fast enough to catch it

duckfez:honk:  2:35 PM
p. sure it is, especially since I think inotify gets used (some) now
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To solve, I just had Python write to a temp .csv and then I used &lt;CODE&gt;shutil.move(temp.csv, myfinalfile.csv)&lt;/CODE&gt;. It is possible that changing your Python code to write to the .csv using &lt;CODE&gt;a&lt;/CODE&gt; instead of &lt;CODE&gt;w&lt;/CODE&gt; may fix the issue as well.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Apr 2020 22:11:46 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2020-04-01T22:11:46Z</dc:date>
    <item>
      <title>Monitor is not working with Python-generated .csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitor-is-not-working-with-Python-generated-csv/m-p/465606#M80250</link>
      <description>&lt;P&gt;I have a .csv file that is being appended to every few minutes using Python. However, &lt;CODE&gt;monitor&lt;/CODE&gt; reindexes everything each time it is written to, not just the new data. The filename and first 256 bytes are the same, so crcSalt shouldn't be an issue here.&lt;/P&gt;

&lt;P&gt;How can I fix this?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 22:06:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitor-is-not-working-with-Python-generated-csv/m-p/465606#M80250</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-04-01T22:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Monitor is not working with Python-generated .csv</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitor-is-not-working-with-Python-generated-csv/m-p/465607#M80251</link>
      <description>&lt;P&gt;Thanks to @micahkemp and @dwaddle for their assistance here. I posted this question to document the solution for the Splunk community.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;micah:fez:  2:34 PM
if that file ever looks like it's less than 256 bytes, say right after it's re-created, but before it's written with the exact same content
2:35
splunk might be fast enough to catch it

duckfez:honk:  2:35 PM
p. sure it is, especially since I think inotify gets used (some) now
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To solve, I just had Python write to a temp .csv and then I used &lt;CODE&gt;shutil.move(temp.csv, myfinalfile.csv)&lt;/CODE&gt;. It is possible that changing your Python code to write to the .csv using &lt;CODE&gt;a&lt;/CODE&gt; instead of &lt;CODE&gt;w&lt;/CODE&gt; may fix the issue as well.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 22:11:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitor-is-not-working-with-Python-generated-csv/m-p/465607#M80251</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-04-01T22:11:46Z</dc:date>
    </item>
  </channel>
</rss>

