<?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 Universal Forwarder don't write events to persistent queue with graceful service shutdown in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363381#M66208</link>
    <description>&lt;P&gt;I'm using distributed Universal Forwarders in remote location in order to collect events from remote sites. To prevent data loss I configured persistent queue on disk for specific inputs. &lt;/P&gt;

&lt;P&gt;input.conf&lt;BR /&gt;
[udp://514]&lt;BR /&gt;
connection_host = ip&lt;BR /&gt;
index = remotelogs&lt;BR /&gt;
queueSize = 1MB&lt;BR /&gt;
persistentQueueSize = 10MB&lt;BR /&gt;
sourcetype = syslog&lt;/P&gt;

&lt;P&gt;Everything works perfect except the following case. While the UF is disconnected from Splunk Server the events received by UF are stored in memory. Even when the UF is gracefully stoped by using: &lt;EM&gt;$SPLUNK_HOME/bin/splunk stop&lt;/EM&gt; the events from memory are not saved to persistent queue on disk. &lt;/P&gt;

&lt;P&gt;Dose anyone knows if this is a known issue or an bug? I didn't find any references on this issue. &lt;/P&gt;

&lt;P&gt;Evaluated versions: 7.0.1 for both Server and UF.  &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:24:58 GMT</pubDate>
    <dc:creator>gheodan</dc:creator>
    <dc:date>2020-09-29T17:24:58Z</dc:date>
    <item>
      <title>Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363381#M66208</link>
      <description>&lt;P&gt;I'm using distributed Universal Forwarders in remote location in order to collect events from remote sites. To prevent data loss I configured persistent queue on disk for specific inputs. &lt;/P&gt;

&lt;P&gt;input.conf&lt;BR /&gt;
[udp://514]&lt;BR /&gt;
connection_host = ip&lt;BR /&gt;
index = remotelogs&lt;BR /&gt;
queueSize = 1MB&lt;BR /&gt;
persistentQueueSize = 10MB&lt;BR /&gt;
sourcetype = syslog&lt;/P&gt;

&lt;P&gt;Everything works perfect except the following case. While the UF is disconnected from Splunk Server the events received by UF are stored in memory. Even when the UF is gracefully stoped by using: &lt;EM&gt;$SPLUNK_HOME/bin/splunk stop&lt;/EM&gt; the events from memory are not saved to persistent queue on disk. &lt;/P&gt;

&lt;P&gt;Dose anyone knows if this is a known issue or an bug? I didn't find any references on this issue. &lt;/P&gt;

&lt;P&gt;Evaluated versions: 7.0.1 for both Server and UF.  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363381#M66208</guid>
      <dc:creator>gheodan</dc:creator>
      <dc:date>2020-09-29T17:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363382#M66209</link>
      <description>&lt;P&gt;I had a similar doubt from the indexer side of things - &lt;A href="https://answers.splunk.com/answers/607972/does-an-indexer-write-its-queues-to-disk-when-we-s.html"&gt;Does an indexer write its queues to disk when we shut it down?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 22:53:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363382#M66209</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-01-05T22:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363383#M66210</link>
      <description>&lt;P&gt;Hi community. &lt;/P&gt;

&lt;P&gt;I receive the final answer from support team. &lt;/P&gt;

&lt;P&gt;I have discussed the topic with one of our Senior Sustaining Engineering colleagues and we realised that the documentation doesn't seem to be totally accurate here. Whenever it talks about crash, it should also mention "splunk stop". These are the 4 main scenarios I would imagine in a simple forwarder-receiver topology:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;List item&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;A. forwarder is crashing, while it is unable to forward data to the receiver (regardless if it's due to unreachable receiver, network issues or incorrect/missing outputs.conf or alike): in-memory data will not be moved into the persistent queue, even if the persistent queue still has got enough space to accomodate the in-memory queue data.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;List item&lt;/P&gt;

&lt;P&gt;B. forwarder is gracefully shut down, while it is unable to forward data to the receiver (regardless if it's due to unreachable receiver, network issues or incorrect/missing outputs.conf or alike): in-memory data will not be moved into the persistent queue, even if the persistent queue still has got enough space to accomodate the in-memory queue data.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;List item&lt;/P&gt;

&lt;P&gt;C. forwarder is crashing, but has been able to forward data to the receiver so far: persistent queue data will be preserved on disk, however in-memory data is very likely to be lost.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;List item&lt;/P&gt;

&lt;P&gt;D. forwarder is gracefully shut down, but has been able to forward data to the receiver so far: both persistent queue and in-memory data will be forwarded (and indexed) before the forwarder is fully shut-down. *&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;I will inform the documentation team about this missing detail.&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Best regards, &lt;BR /&gt;
Daniel &lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363383#M66210</guid>
      <dc:creator>gheodan</dc:creator>
      <dc:date>2018-01-17T14:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363384#M66211</link>
      <description>&lt;P&gt;A persistent queue will only get written to once you have filled up the in memory queue.&lt;/P&gt;

&lt;P&gt;So if your forwarder is keeping up with the rate of events, nothing gets written to disk (as the memory queue is not full)&lt;BR /&gt;
Once the in memory queue is full, splunk will start writing to disk, until the p-queue is full (and then it drops events)&lt;/P&gt;

&lt;P&gt;Now, in the event that you "shutdown" an indexer, it will delay the shutdown until the memory queue and p-queue have been drained - nothing &lt;EM&gt;should&lt;/EM&gt; persist on disk during a reboot.&lt;/P&gt;

&lt;P&gt;However - if your forwarder is struggling to offload its events, your memory queue is full, you have data in the p-queue and your forwarder crashes... in that case, you will have lost the contents of the memory queue, but data held in the p-queue will be persisted, and offloaded to your indexer when it restarts.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Usepersistentqueues"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Usepersistentqueues&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you have forwarders (or indexers)  which get periodically backlogged, persistent queues can help buffer events so they don't get dropped during busy periods, they are not really for HA/DR/"server room oopsies".&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 15:16:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363384#M66211</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2018-01-17T15:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363385#M66212</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;This is partial true. Please see below the answer I received from support. &lt;/P&gt;

&lt;P&gt;These are the 4 main scenarios I would imagine in a simple forwarder-receiver topology:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;A. forwarder is crashing, while it is unable to forward data to the receiver (regardless if it's due to unreachable receiver, network issues or incorrect/missing outputs.conf or alike): in-memory data will not be moved into the persistent queue, even if the persistent queue still has got enough space to accomodate the in-memory queue data.
B. forwarder is gracefully shut down, while it is unable to forward data to the receiver (regardless if it's due to unreachable receiver, network issues or incorrect/missing outputs.conf or alike): in-memory data will not be moved into the persistent queue, even if the persistent queue still has got enough space to accomodate the in-memory queue data.
C. forwarder is crashing, but has been able to forward data to the receiver so far: persistent queue data will be preserved on disk, however in-memory data is very likely to be lost.
D. forwarder is gracefully shut down, but has been able to forward data to the receiver so far: both persistent queue and in-memory data will be forwarded (and indexed) before the forwarder is fully shut-down.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Best regards, &lt;BR /&gt;
Daniel &lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 15:24:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363385#M66212</guid>
      <dc:creator>gheodan</dc:creator>
      <dc:date>2018-01-17T15:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363386#M66213</link>
      <description>&lt;P&gt;To be fair, it’s exactly true, because that’s what my answer described &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The only scenario in which data survives a restart is if the forwarder is restarted ungracefully (crash, or forced by the os) while it already has data in the pqueue&lt;/P&gt;

&lt;P&gt;In what scenario are you relying on pqueues, because there is almost certainly a better way to preserve your event data through restarts&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 17:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363386#M66213</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2018-01-17T17:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363387#M66214</link>
      <description>&lt;P&gt;What better mechanism is there to persist data when Splunk can't reach the indexers? Splunk continues to read  log files. It is  committing the data to a memory queue, but not a pqueue, because the memory hasn't filled up. So when the endpoint with the UF is shutdown, those events are just lost.  It should either stop reading inputs when it can't reach the indexer or commit to disk as it halts. &lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 22:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363387#M66214</guid>
      <dc:creator>wkupersa</dc:creator>
      <dc:date>2020-02-17T22:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363388#M66215</link>
      <description>&lt;P&gt;The obvious one is don’t use network inputs. - use syslog with a UF. &lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 22:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363388#M66215</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-02-17T22:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Universal Forwarder don't write events to persistent queue with graceful service shutdown</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363389#M66216</link>
      <description>&lt;P&gt;The use case is laptops. People disconnect from the corporate network. UF keeps reading events but doesn't persist many of them. When user later shuts down their laptop, the events get lost. &lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 00:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Universal-Forwarder-don-t-write-events-to-persistent-queue-with/m-p/363389#M66216</guid>
      <dc:creator>wkupersa</dc:creator>
      <dc:date>2020-02-18T00:06:15Z</dc:date>
    </item>
  </channel>
</rss>

