<?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: Why does data stop getting indexed after a log rotation? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287761#M54976</link>
    <description>&lt;P&gt;In our place we normally add &lt;CODE&gt;crcSalt&lt;/CODE&gt; and &lt;CODE&gt;initCrcLength&lt;/CODE&gt; when things don't work as expected. However, since we already speak about it, it's fun to look further.&lt;/P&gt;

&lt;P&gt;A very thorough explanation about &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Howlogfilerotationishandled"&gt;How Splunk software handles log file rotation&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;It says at the end of the page -&lt;/P&gt;

&lt;P&gt;-- Do not use &lt;CODE&gt;crcSalt =&lt;/CODE&gt;  with &lt;STRONG&gt;rolling log files&lt;/STRONG&gt;, or any other scenario in which logfiles get renamed or moved to another monitored location. Doing so prevents Splunk software from recognizing log files across the roll or rename, which results in the data being reindexed. &lt;/P&gt;</description>
    <pubDate>Sun, 31 Jul 2016 00:52:48 GMT</pubDate>
    <dc:creator>ddrillic</dc:creator>
    <dc:date>2016-07-31T00:52:48Z</dc:date>
    <item>
      <title>Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287756#M54971</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I noticed that, right after a log rotation, the data is not being indexed anymore.&lt;BR /&gt;
Data is still going through /var/log/myapp.log and /var/log/messages (rsyslog UDP), so it all arrives on the machine (at 100%), but it is not being indexed.&lt;/P&gt;

&lt;P&gt;On Splunk, I am monitoring logs arriving with real-time searches. Before log-rotate, everything is fine and logs are arriving on a regular basis. After logrotate, I do not get anything anymore.&lt;/P&gt;

&lt;P&gt;Here is my inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/myapp.log]
sourcetype = myappsourcetype
crcSalt = &amp;lt;SOURCE&amp;gt;
crcSalt = 2048
disabled = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My log rotate conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"/var/log/myapp.log" {
  monthly
  size 100M
  rotate 30
  compress
  postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2&amp;gt;/dev/null` &amp;amp;&amp;gt; /dev/null || true
  endscript
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My sourcetype shouldn't be the problem as it only contains some side fields extractions.&lt;/P&gt;

&lt;P&gt;Thank you very much in advance&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2016 00:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287756#M54971</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-07-30T00:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287757#M54972</link>
      <description>&lt;P&gt;It looks like that deleting the file and restarting rsyslog fix the issue. &lt;BR /&gt;
Does that mean the problem is coming from Rsyslog or Splunk "loosing his pointer" to the file? &lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2016 01:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287757#M54972</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-07-30T01:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287758#M54973</link>
      <description>&lt;P&gt;For one thing - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;crcSalt = &amp;lt;SOURCE&amp;gt;
crcSalt = 2048
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should probably  be -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;crcSalt = &amp;lt;SOURCE&amp;gt;
initCrcLength = 2048
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jul 2016 01:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287758#M54973</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-07-30T01:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287759#M54974</link>
      <description>&lt;P&gt;You very very very very likely do not want to use crcSalt. It's the truly rare log file that requires it.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2016 01:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287759#M54974</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-07-30T01:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287760#M54975</link>
      <description>&lt;P&gt;Can you explain why you think you need crcSalt? And I'm guessing you meant initCrcLength for the second crcSalt entry.&lt;/P&gt;

&lt;P&gt;There are very particular reasons for using crcSalt, and I'm going to take a guess that UDP delivered syslog will not fit that criteria 99% of the time. You would only need initCrcLength if the beginning of your file always had a long header that was identical each time.&lt;/P&gt;

&lt;P&gt;Try removing both crcSalt entries and see what happens.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2016 01:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287760#M54975</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-07-30T01:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287761#M54976</link>
      <description>&lt;P&gt;In our place we normally add &lt;CODE&gt;crcSalt&lt;/CODE&gt; and &lt;CODE&gt;initCrcLength&lt;/CODE&gt; when things don't work as expected. However, since we already speak about it, it's fun to look further.&lt;/P&gt;

&lt;P&gt;A very thorough explanation about &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Howlogfilerotationishandled"&gt;How Splunk software handles log file rotation&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;It says at the end of the page -&lt;/P&gt;

&lt;P&gt;-- Do not use &lt;CODE&gt;crcSalt =&lt;/CODE&gt;  with &lt;STRONG&gt;rolling log files&lt;/STRONG&gt;, or any other scenario in which logfiles get renamed or moved to another monitored location. Doing so prevents Splunk software from recognizing log files across the roll or rename, which results in the data being reindexed. &lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 00:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287761#M54976</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-07-31T00:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287762#M54977</link>
      <description>&lt;P&gt;ddrillic: Ding!&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2016 02:08:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287762#M54977</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-07-31T02:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287763#M54978</link>
      <description>&lt;P&gt;I agree with twinspop, you don't need crcSalt and initCrcLength parameters.  What problem are you facing?  Is your file not getting monitored? &lt;/P&gt;

&lt;P&gt;Why are you using postrotate? Do you need  to kill any process on log rotation?  Try removing this parameter. &lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 06:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287763#M54978</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2016-08-01T06:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287764#M54979</link>
      <description>&lt;P&gt;Thanks! So I removed crcSalt but it is still the same issue: I receive the logs but right after logrotate, they are not arriving anymore.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 23:12:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287764#M54979</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-08-01T23:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287765#M54980</link>
      <description>&lt;P&gt;I supposed that Splunk was not reading enough data in each event so I increased initCrcLength.&lt;BR /&gt;
As for CrcSalt, it was just a bet, I removed it.&lt;BR /&gt;
My file is getting monitoring but the data is not getting to the dashboard, I do not see them after my logrotate. But the file is still getting filled with incoming data.&lt;/P&gt;

&lt;P&gt;As for the -HUP, it is simply to close the file and reload rsyslog, to make the process cleaner. I tried removing it and it does not help at all. &lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 23:14:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287765#M54980</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-08-01T23:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287766#M54981</link>
      <description>&lt;P&gt;Thank you very much, I removed crcSalt but I am still encoutering the same issue.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 23:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287766#M54981</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-08-01T23:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287767#M54982</link>
      <description>&lt;P&gt;Just to be clear... you restarted the forwarder after making this change?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 23:21:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287767#M54982</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-08-01T23:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287768#M54983</link>
      <description>&lt;P&gt;Yes I removed crcSalt and restarting splunk right after.&lt;BR /&gt;
I then did a logrotate -f /var/log/myapp.log and then I could not see the new events anymore.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 23:45:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287768#M54983</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-08-01T23:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287769#M54984</link>
      <description>&lt;P&gt;What do the _internal logs say? Check with &lt;CODE&gt;index=_internal host=yourhost myapp.log&lt;/CODE&gt;. You should see a series of logs there at the time you forced the log rotation.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:27:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287769#M54984</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2020-09-29T10:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287770#M54985</link>
      <description>&lt;P&gt;I have encountered the problem. Upon rotation the current logfile is moved and compressed. Then a new file is created with the same name.  That is a problem since Splunk has the log file opened at the time of rotation, it seems to follow the old file (nothing else is written to it so you don't see any more data).&lt;/P&gt;

&lt;P&gt;The solution is with your log rotate script.  You either need to use  the copytruncate option or else the postrotate/script option to restart the Splunk forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 01:14:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287770#M54985</guid>
      <dc:creator>sjohnson_splunk</dc:creator>
      <dc:date>2016-08-02T01:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287771#M54986</link>
      <description>&lt;P&gt;You, Sir, made my day (and probably a few more). &lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 02:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287771#M54986</guid>
      <dc:creator>Arkon</dc:creator>
      <dc:date>2016-08-02T02:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287772#M54987</link>
      <description>&lt;P&gt;Wow, good one to know! Almost seems like a bug, or at least a potential feature enhancement.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 02:18:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287772#M54987</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-08-02T02:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287773#M54988</link>
      <description>&lt;P&gt;I have the same issue with my suse forwarder 6.4.3.&lt;BR /&gt;
The log file will be renamed when its size reaches 20MB. And a new log file with the original name will be created to log data. For example, after abc.123.log reaches 20MB, it will be renamed as abc.123.1501.log. And a new abc.123.log will be created.&lt;BR /&gt;
After the log was rotated, there's a chance that the new data in the log will not be collected. And if you use lsof command to check splunkd's pid, you may find that splunkd opens the renamed history log(abc.123.1501.log), not the right file(abc.123.log).&lt;BR /&gt;
Is this a bug?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 16:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287773#M54988</guid>
      <dc:creator>witski</dc:creator>
      <dc:date>2018-04-16T16:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287774#M54989</link>
      <description>&lt;P&gt;We are on forwarder 7.0.3. We seem to have similar issue. What should be the ideal fix from Splunk monitoring side?&lt;BR /&gt;
Below is the monitoring stanza&lt;/P&gt;

&lt;P&gt;[monitor:///opt/mapr/hadoop/hadoop/logs/&lt;EM&gt;nodemanager&lt;/EM&gt;]&lt;BR /&gt;
sourcetype = my_st &lt;BR /&gt;
index = my_index&lt;BR /&gt;
disabled = 0 &lt;BR /&gt;
ignoreOlderThan = 2h&lt;/P&gt;

&lt;P&gt;The latest file will be with &lt;CODE&gt;yarn-mapr-nodemanager-host_name.log&lt;/CODE&gt; and the latest archived file be with &lt;CODE&gt;yarn-mapr-nodemanager-host_name.log.1&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;What is interesting is intermittently on certain servers, the current file gets indexed only at the time of its roll/archival i.e. lets say after 6 hours. And the issue of live/current file not getting indexed on time does not happen all the time. The next live file might get indexed on time. To me, it sounds like what &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/57138"&gt;@sjohnson_splunk&lt;/a&gt; has mentioned. But there should be ideal settings to avoid this. Any insights on this will be helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:59:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287774#M54989</guid>
      <dc:creator>thirusama</dc:creator>
      <dc:date>2020-09-29T22:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why does data stop getting indexed after a log rotation?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287775#M54990</link>
      <description>&lt;P&gt;Hi, @thirusama , I believe you can resolve your problem by changing your monitored path.&lt;/P&gt;

&lt;P&gt;There is no need to collect the archived file again since you have already collected the current file (if it functions normally). &lt;BR /&gt;
Hence, there is no need to monitor the whole path. You can add &lt;EM&gt;.log to the end of your current path, which will be "/opt/mapr/hadoop/hadoop/logs/nodemanager/&lt;/EM&gt;.log".&lt;BR /&gt;
Doing this will let your splunk forwarder to focus on current files.&lt;/P&gt;

&lt;P&gt;And my issue has been confirmed by the official support team as a bug solved since 6.6.4. It's recorded as SPL-142334.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 03:16:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-does-data-stop-getting-indexed-after-a-log-rotation/m-p/287775#M54990</guid>
      <dc:creator>witski</dc:creator>
      <dc:date>2019-01-29T03:16:32Z</dc:date>
    </item>
  </channel>
</rss>

