<?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: Splunk Reindexes File that gets a new first line when closed in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213762#M41999</link>
    <description>&lt;P&gt;I second this.  And third it.  All in favor?&lt;/P&gt;

&lt;P&gt;Really, though, IMO this is inordinately strange behavior from a logger.  There's obviously some business reason or some reason involving an inferior product being worked around that caused the logging to be created this way, and it could be at least worth an ask to see if that behavior can be fixed now.  There are quite a few compelling reasons.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Apr 2016 18:32:27 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2016-04-24T18:32:27Z</dc:date>
    <item>
      <title>Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213746#M41983</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;My problem is simple to explain: I have an app that generates logs that are written whenever a new action is performed.&lt;/P&gt;

&lt;P&gt;The problem is, when the session is over, the first line of that log is changed to include the close time of the session, which makes splunk REINDEX everything on the log.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 20:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213746#M41983</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2016-04-23T20:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213747#M41984</link>
      <description>&lt;P&gt;From Splunk's point of view, that's intended behaviour. If you're tailing a log file and its start changes, it's considered to be a new log file.&lt;/P&gt;

&lt;P&gt;Have your application move the file to a different place after completion, and monitor that different place with Splunk.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 21:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213747#M41984</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-23T21:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213748#M41985</link>
      <description>&lt;P&gt;If the events are being written in near real time you could just use DATETIME_CONFIG=NONE in your props so that Splunk will use the time the file is written as the event date.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:02:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213748#M41985</guid>
      <dc:creator>bentleymi</dc:creator>
      <dc:date>2016-04-24T14:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213749#M41986</link>
      <description>&lt;P&gt;Timestamp extraction won't influence reindexing files that have their beginning changed later on.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213749#M41986</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-24T14:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213750#M41987</link>
      <description>&lt;P&gt;Yeah I'm trying to edit he could try  to decrease Crc init to a lower value possibly too.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213750#M41987</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-04-24T14:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213751#M41988</link>
      <description>&lt;P&gt;I doubt that would work. From Splunk's point of view, a file is unchanged if the start CRC, the end CRC, and the size doesn't change. Adding a session end to the start would inevitably change the size. If the size changes in any context other than appending to the end, Splunk will reindex.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213751#M41988</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-24T14:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213752#M41989</link>
      <description>&lt;P&gt;Firstly, Thanks for the suggestion. It would avoid a real time monitor of the logo content though.. because splunk would only see the file when it would be full and closed...  Nota an óption for our case&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213752#M41989</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2016-04-24T14:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213753#M41990</link>
      <description>&lt;P&gt;Can you show us what the first line of the file looks like before and after the process is completed?&lt;BR /&gt;
Maybe we can use props to delete events when they start with one or the other.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:27:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213753#M41990</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-04-24T14:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213754#M41991</link>
      <description>&lt;P&gt;I agree with you, I feel my hands are tied on this because I cant avoid it to check the beggining of the file&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:28:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213754#M41991</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2016-04-24T14:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213755#M41992</link>
      <description>&lt;P&gt;Mkay, here's another option: Have the application append the session end time to the end of the log file.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 14:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213755#M41992</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-24T14:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213756#M41993</link>
      <description>&lt;P&gt;Your hands are far from tied here, heck they aren't even dirty yet! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;martin_mueller's suggestion of moving this file's data to a different location for monitoring is the "best" option here without changing your app's log behavior and does not stop you from maintaining a "realtime" view of the data. &lt;/P&gt;

&lt;P&gt;Your file is fundamentally not fit for direct monitor by splunk without dealing with re-index of data/dedup of duplicate events (which is a completely viable option if license/filesize allow). So now what???&lt;/P&gt;

&lt;P&gt;Some factors on how to attack this include:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;What operating system are you dealing with? *nix? windows?&lt;/LI&gt;
&lt;LI&gt;What Admin/scripting skills are available to you?&lt;/LI&gt;
&lt;LI&gt;How long are these files open and how many do you have at any one time? How big are they?&lt;/LI&gt;
&lt;LI&gt;How often are events written to this file?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I would begin with the option of tailing the writes to this file to another file. Depending on the specifics of your app, it isn't all that challenging to write a small script to maintain a copy of this file at all times. This allows you to control the behavior of the data while maintaining a "realtime" look at this file. &lt;/P&gt;

&lt;P&gt;Heck, even a cron job that simply checks this file at a tiny interval and does a cp myUglyFile.log &amp;gt;&amp;gt; myBeautifulSplunkFormattedLog.log then cleans up dupe lines before splunk ingestion could work....&lt;/P&gt;

&lt;P&gt;It will take some solutioneering, but this is totaly doable..many data sources require a bit of massaging to help splunk spend its time doing what it does best&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 16:15:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213756#M41993</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-04-24T16:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213757#M41994</link>
      <description>&lt;P&gt;Hi mmodestino,&lt;/P&gt;

&lt;P&gt;Of course I can use scripts and lots of other stuff to get around this. The objective though is to keep everything on splunk side! And this is the point here, it looks like for now I have to change things other than splunk conf files.&lt;/P&gt;

&lt;P&gt;So I am using a Splunk HF on WINDOWS to process these files and sends them to an Splunk Indexer on CentOS. I can do explore administrational and scripting skills to solve this. &lt;/P&gt;

&lt;P&gt;The files can be opened for hours, can be written every second or be left unchanged for minutes. &lt;/P&gt;

&lt;P&gt;Everything can be done right? This is just something I would like to do ONLY on Splunk, without scripts!&lt;/P&gt;

&lt;P&gt;Thank you for your suggestions&lt;/P&gt;

&lt;P&gt;P.S.: copying thousands of files with many Gb is not a viable option. Neither cutting them&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 16:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213757#M41994</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2016-04-24T16:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213758#M41995</link>
      <description>&lt;P&gt;Fair enough...I have heard many people say the same thing...eventually every admin figures out the difference between what you CAN do in splunk and what you SHOULD do...&lt;/P&gt;

&lt;P&gt;Before you look to bend splunk to the behaviour of some other app, then i would recommend studying how splunk monitors a file:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.0/Data/Howlogfilerotationishandled"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.0/Data/Howlogfilerotationishandled&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And then I would suggest seeing if you can shrink the crc check on this input to a length that would keep splunks ability to check for unique files, but not check far enough to see what ur app writes to the top of the file on session close&lt;/P&gt;

&lt;P&gt;can u share the first 256 bytes of a new file and a closed file??&lt;/P&gt;

&lt;P&gt;At the end of the day this is not a logfile and saying "i want to do it on the splunk side" when talking about something splunk doesnt natively do, is going to require more than some conf file tweaks.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 17:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213758#M41995</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-04-24T17:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213759#M41996</link>
      <description>&lt;P&gt;I'm definitly gonna check that link.&lt;/P&gt;

&lt;P&gt;As you mentioned, the minimum that splunk uses to check if a file has been indexed or not is 256 bytes. The problem is that my app writes a close date on the first line of the log, at the time it actually closes an app session.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Open&lt;/STRONG&gt; file first line: 2021 2016-04-24 18:28:54 0000-00-00 00:00:00 +0100 00000cf0 001 003f 0001 09&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Closed&lt;/STRONG&gt; file first line: 2021 2016-04-24 18:28:54 2016-04-24 18:29:31 +0100 00000cf0 001 003f 0001 &lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 17:42:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213759#M41996</guid>
      <dc:creator>TiagoMatos</dc:creator>
      <dc:date>2016-04-24T17:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213760#M41997</link>
      <description>&lt;P&gt;Could you use a crc length of, like, 23?  I was eyeballing it, you'll have to count the right number properly!  That'll let it use the FIRST date in it as the check for when it's a new file, ignoring the newly written closing log file time, when that happens.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 18:29:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213760#M41997</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-24T18:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213761#M41998</link>
      <description>&lt;P&gt;ah yeah, sucks that it's so tight to the beginning of the file...&lt;/P&gt;

&lt;P&gt;Pretty much guarantees you can't use splunk's ability to monitor the file in "realtime"..&lt;/P&gt;

&lt;P&gt;Also be weary that if you are monitoring a directory on the HF that has thousands of files ( like var/log/*) it will have to keep track of all the files and can impact performance.&lt;/P&gt;

&lt;P&gt;I speak from experience and is why i told you the tale of moving data around, cause once splunk indexes you will want to get rid of those files if you can...&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 18:30:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213761#M41998</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-04-24T18:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213762#M41999</link>
      <description>&lt;P&gt;I second this.  And third it.  All in favor?&lt;/P&gt;

&lt;P&gt;Really, though, IMO this is inordinately strange behavior from a logger.  There's obviously some business reason or some reason involving an inferior product being worked around that caused the logging to be created this way, and it could be at least worth an ask to see if that behavior can be fixed now.  There are quite a few compelling reasons.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 18:32:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213762#M41999</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-24T18:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213763#M42000</link>
      <description>&lt;P&gt;initCRCLength has to be a minimum of 256 &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 19:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213763#M42000</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-04-24T19:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213764#M42001</link>
      <description>&lt;P&gt;Does anyone know why there's an arbitrary lower limit?  &lt;/P&gt;

&lt;P&gt;It makes me suspicious when the smallest possible value for a variable is also the default, and that default/smallest value isn't zero.  Suspicious of what?  I'm not sure, but suspicious of something.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Why not let the user decide what they need?  There are cases where having it bigger is useful, and we've just stumbled across a situation where being able to make it smaller would be vastly simpler, easier and better than any other solution (excepting "fix the logger").&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 19:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213764#M42001</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-24T19:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Reindexes File that gets a new first line when closed</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213765#M42002</link>
      <description>&lt;P&gt;my thoughts exactly...will see what I can find out!&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 19:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-Reindexes-File-that-gets-a-new-first-line-when-closed/m-p/213765#M42002</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-04-24T19:46:13Z</dc:date>
    </item>
  </channel>
</rss>

