<?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 Splunk always one event behind in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77955#M15949</link>
    <description>&lt;P&gt;I've got a scripted input that is giving me a bit of a headache. My index always be one line behind. For example:&lt;/P&gt;

&lt;P&gt;My log looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
2013-03-27      10:04:40 -  Event 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But my index only shows 2 events. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If another line is added to the output: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
2013-03-27      10:04:40 -  Event 3
2013-03-27      12:24:40 -  Event 4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then my index shows 3 events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
2013-03-27      10:04:40 -  Event 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's like it's one-step behind all the time. I've got the script running in bash, and it shows the events correctly. I also don't think this is a multi-line issue, as each event is added as a separate item in the index correctly, it's not merging the lines.&lt;BR /&gt;
I also added \n\r to the end of each result so it looked like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1

2013-03-27      09:43:29 -  Event 2

2013-03-27      10:04:40 -  Event 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the index was still one line behind, only showing events 1 and 2 until event 4 came in.&lt;/P&gt;

&lt;P&gt;Is there anything I can do in order to debug the input from the script to the index process?&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2013 16:25:10 GMT</pubDate>
    <dc:creator>CaptSpify</dc:creator>
    <dc:date>2013-03-28T16:25:10Z</dc:date>
    <item>
      <title>Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77955#M15949</link>
      <description>&lt;P&gt;I've got a scripted input that is giving me a bit of a headache. My index always be one line behind. For example:&lt;/P&gt;

&lt;P&gt;My log looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
2013-03-27      10:04:40 -  Event 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But my index only shows 2 events. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If another line is added to the output: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
2013-03-27      10:04:40 -  Event 3
2013-03-27      12:24:40 -  Event 4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then my index shows 3 events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1
2013-03-27      09:43:29 -  Event 2
2013-03-27      10:04:40 -  Event 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's like it's one-step behind all the time. I've got the script running in bash, and it shows the events correctly. I also don't think this is a multi-line issue, as each event is added as a separate item in the index correctly, it's not merging the lines.&lt;BR /&gt;
I also added \n\r to the end of each result so it looked like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-03-27      05:30:39 -  Event 1

2013-03-27      09:43:29 -  Event 2

2013-03-27      10:04:40 -  Event 3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the index was still one line behind, only showing events 1 and 2 until event 4 came in.&lt;/P&gt;

&lt;P&gt;Is there anything I can do in order to debug the input from the script to the index process?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 16:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77955#M15949</guid>
      <dc:creator>CaptSpify</dc:creator>
      <dc:date>2013-03-28T16:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77956#M15950</link>
      <description>&lt;P&gt;Are piping to a log file and then reading the log file or our using the scripted input and piping stdout?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 16:45:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77956#M15950</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-03-28T16:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77957#M15951</link>
      <description>&lt;P&gt;I'm piping to stdout. Should it be going into a log-file?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 17:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77957#M15951</guid>
      <dc:creator>CaptSpify</dc:creator>
      <dc:date>2013-03-28T17:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77958#M15952</link>
      <description>&lt;P&gt;No, I would continue to use stdout. What is your scripted input interval also how busy is your indexer?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 17:37:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77958#M15952</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-03-28T17:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77959#M15953</link>
      <description>&lt;P&gt;Add SHOULD_LINEMERGE = false to your props. Splunk is waiting for the next event to see if it needs to merge it into the current one, so it can't index the current one until it sees that the next one contains a valid date.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 18:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77959#M15953</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-03-28T18:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77960#M15954</link>
      <description>&lt;P&gt;Or if you write to a file, a long enough (default 3 seconds) pause in new data written to a file will cause the file monitor to force an end to the event. There's no way in a scripted input to force the end (add a "_done" key) but you can do this in a modular input.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 18:36:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77960#M15954</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-03-28T18:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77961#M15955</link>
      <description>&lt;P&gt;Sorry for the delay.&lt;/P&gt;

&lt;P&gt;My interval is -1&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2013 22:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77961#M15955</guid>
      <dc:creator>CaptSpify</dc:creator>
      <dc:date>2013-04-11T22:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk always one event behind</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77962#M15956</link>
      <description>&lt;P&gt;I've set the line-merge to false, and now it seems to be two events behind STDOUT. Color me confused. &lt;/P&gt;

&lt;P&gt;Any other suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2013 23:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-always-one-event-behind/m-p/77962#M15956</guid>
      <dc:creator>CaptSpify</dc:creator>
      <dc:date>2013-04-11T23:00:57Z</dc:date>
    </item>
  </channel>
</rss>

