<?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: Does useACK=true in inputs.conf [batch://] stanza ensure that the file will be indexed BEFORE being deleted? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251836#M48464</link>
    <description>&lt;P&gt;So when I set useACK=true, Splunk will make a copy of the file in it's wait queue when it sends it.  It will then delete the original file (because move_policy=sinkhole).  &lt;/P&gt;

&lt;P&gt;Then, when it receives the ACK from the indexer, it deletes the copy from the wait queue and life goes on.  If it doesn't receive the ACK, it will try to resend the copy of the file from the wait queue?&lt;/P&gt;

&lt;P&gt;Is that correct?  I just want to make sure I'm understanding the flow...&lt;/P&gt;</description>
    <pubDate>Fri, 18 Mar 2016 12:42:26 GMT</pubDate>
    <dc:creator>lyndac</dc:creator>
    <dc:date>2016-03-18T12:42:26Z</dc:date>
    <item>
      <title>Does useACK=true in inputs.conf [batch://] stanza ensure that the file will be indexed BEFORE being deleted?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251834#M48462</link>
      <description>&lt;P&gt;I have an application which writes .json files into a directory.   I would like to be able to monitor the directory and forward all files to the indexers.   The files are written once, and never updated, so I don't need to monitor the file for changes, just make sure that any new files added to the directory are forwarded for indexing.    The size of the files will vary, they can be anywhere between 20K and several MB in size.&lt;/P&gt;

&lt;P&gt;I know that I can use the [monitor:] input to do this, but it will not clean up the files.  I see that the [batch:] input will cleanup the files, but I'm unclear if batch monitors the directory for new files as well.   If it does, will adding useACK=true to the stanza guarantee that the file will not be deleted until the ACK is received from the indexer?   My stanza in inputs.conf would look like this (I think):&lt;/P&gt;

&lt;P&gt;[batch:///ingest/data]&lt;BR /&gt;
index=foo&lt;BR /&gt;
sourcetype=foo_json&lt;BR /&gt;
useACK=true&lt;BR /&gt;
move_policy=sinkhole&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:07:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251834#M48462</guid>
      <dc:creator>lyndac</dc:creator>
      <dc:date>2020-09-29T09:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Does useACK=true in inputs.conf [batch://] stanza ensure that the file will be indexed BEFORE being deleted?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251835#M48463</link>
      <description>&lt;P&gt;Hello lyndac,&lt;/P&gt;

&lt;P&gt;Right, to answer:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;useACK (Using Ackknowledge)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Check this:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Protectagainstlossofin-flightdata"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Protectagainstlossofin-flightdata&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Activating Ack is global to your forwarder, not specific to a file monitor input. (so in outputs.conf, not inputs.conf)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;batch mode and recursive scan&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The batch mode works totally the same the standard monitor does, so yes you can watch for files recursively. (it will not delete directories thought, only monitored files)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;File deletion&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The Splunk instance will delete the file when it entirely filled in queues or forwarded (as far as i know), it has nothing to see directly with Ack activation.&lt;/P&gt;

&lt;P&gt;Then using Ack will ensure that each piece of data will be successfully received and indexed by remote indexers, a bit like TCP versus UDP does on the Network layer with network packets.&lt;/P&gt;

&lt;P&gt;Guilhem&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 23:38:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251835#M48463</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2016-03-17T23:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Does useACK=true in inputs.conf [batch://] stanza ensure that the file will be indexed BEFORE being deleted?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251836#M48464</link>
      <description>&lt;P&gt;So when I set useACK=true, Splunk will make a copy of the file in it's wait queue when it sends it.  It will then delete the original file (because move_policy=sinkhole).  &lt;/P&gt;

&lt;P&gt;Then, when it receives the ACK from the indexer, it deletes the copy from the wait queue and life goes on.  If it doesn't receive the ACK, it will try to resend the copy of the file from the wait queue?&lt;/P&gt;

&lt;P&gt;Is that correct?  I just want to make sure I'm understanding the flow...&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 12:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251836#M48464</guid>
      <dc:creator>lyndac</dc:creator>
      <dc:date>2016-03-18T12:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Does useACK=true in inputs.conf [batch://] stanza ensure that the file will be indexed BEFORE being deleted?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251837#M48465</link>
      <description>&lt;P&gt;hi @lyndac &lt;/P&gt;

&lt;P&gt;I am in exact similar situation ? were you able to identify and make it working successfully with batch input. Just want to make sure, the file is completely indexed before deletion and newer files keep getting created in the directory with application requests, so they need to be monitored, forwarded and deleted.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 21:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Does-useACK-true-in-inputs-conf-batch-stanza-ensure-that-the/m-p/251837#M48465</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2019-08-21T21:19:30Z</dc:date>
    </item>
  </channel>
</rss>

