<?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: Monitoring file being writen on Windows in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350907#M64400</link>
    <description>&lt;P&gt;This parameter can also be tuned and useful if you still fear that behaviour could ever happen&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time_before_close = &amp;lt;integer&amp;gt;
* Modification time delta required before the file monitor can close a file on
  EOF.
* Tells the system not to close files that have been updated in past &amp;lt;integer&amp;gt;
  seconds.
* Defaults to 3.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Mar 2018 08:37:31 GMT</pubDate>
    <dc:creator>tiagofbmm</dc:creator>
    <dc:date>2018-03-14T08:37:31Z</dc:date>
    <item>
      <title>Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350903#M64396</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have to monitor exported events from a remote Windows system. These files are XML files in text format, one XML record per line. Splunk also running on Windows. &lt;/P&gt;

&lt;P&gt;Now the events_last.xml file being written, after the rotate, it gets a new name. Monitoring only this events_last.xml file, can I miss some record because of the logrotate?&lt;/P&gt;

&lt;P&gt;What do you suggest how to Index these files? Can I monitor events_last.xml, or need to wait for the logrotate?&lt;BR /&gt;
Should we limit the file size because of Splunk?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;BR /&gt;
Based on the answers as I understand: It's safe to monitor the directory including the events_last.xml and the rotated files. CRC check will handle it by default.&lt;/P&gt;

&lt;P&gt;What if I only monitoring the events_last.xml? The log source continuously writes the file, and when the time comes, it immediately rotates it. Can Splunk catch the last lines? Or rotate process can be faster and Splunk can miss some lines?&lt;BR /&gt;
I also checked some docs (eg. &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Monitorfilesanddirectories" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Monitorfilesanddirectories&lt;/A&gt;) but did not found detailed one. For &lt;CODE&gt;[monitor://*]&lt;/CODE&gt; stanza I didn't find any interval attributes.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update2&lt;/STRONG&gt;&lt;BR /&gt;
Finally, we monitoring only the rotated files. The delta listening didn't works well because of the XML format. The exporter system puts the new logs not absolutely to the end of file (it puts before the last tag), Splunk re-reads the full file, not just the new logs. &lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
István&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350903#M64396</guid>
      <dc:creator>ikulcsar</dc:creator>
      <dc:date>2020-09-29T18:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350904#M64397</link>
      <description>&lt;P&gt;You can just monitor events_last.xml&lt;/P&gt;

&lt;P&gt;Splunk user CRC so although it is still monitoring the same file, he registers in the fishbucket the last line he has read, and a Checksum of the beginning and end of file. So when you events_last.xml is cleaned and is starting to be written again, Splunk will read that again automatically.&lt;/P&gt;

&lt;P&gt;You won't lose any event.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:42:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350904#M64397</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-13T17:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350905#M64398</link>
      <description>&lt;P&gt;Hey ikulscar,&lt;/P&gt;

&lt;P&gt;You can monitor both the rotated or non-rotated file and the crc will check-out the hash events. &lt;BR /&gt;
Refer this link:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Howlogfilerotationishandled"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Howlogfilerotationishandled&lt;/A&gt;  &lt;/P&gt;

&lt;P&gt;Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:26:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350905#M64398</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-03-13T18:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350906#M64399</link>
      <description>&lt;P&gt;You can't control how fast Splunk is checking the file for new events. The thing is, Splunk is set up for this case as you can see in the docs: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Howlogfilerotationishandled"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Howlogfilerotationishandled&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also I've never seen such a case where a part of a log has been written and the file was immediately rolled so fast Splunk wouldn't detect the new part of log.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 08:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350906#M64399</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T08:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350907#M64400</link>
      <description>&lt;P&gt;This parameter can also be tuned and useful if you still fear that behaviour could ever happen&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;time_before_close = &amp;lt;integer&amp;gt;
* Modification time delta required before the file monitor can close a file on
  EOF.
* Tells the system not to close files that have been updated in past &amp;lt;integer&amp;gt;
  seconds.
* Defaults to 3.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 08:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350907#M64400</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-14T08:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350908#M64401</link>
      <description>&lt;P&gt;Please let me know if the answer was useful for you. If it was, accept it and upvote. If not, give us more input so we can help you with that&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 17:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350908#M64401</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-21T17:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring file being writen on Windows</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350909#M64402</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I saw once a partially read line but didn't investigate. We suspended the plan to monitor the open file because of the XML root element (Update2).&lt;/P&gt;

&lt;P&gt;So far the concluson we cannot monitor an XML file with delta listening.&lt;/P&gt;

&lt;P&gt;What should i do now?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Mar 2018 07:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Monitoring-file-being-writen-on-Windows/m-p/350909#M64402</guid>
      <dc:creator>ikulcsar</dc:creator>
      <dc:date>2018-03-26T07:12:11Z</dc:date>
    </item>
  </channel>
</rss>

