Indexing Retried Events: Avoiding Duplicate Writes in Splunk Forwarders
0 reputation · 18 Aug 2024, 18:07 UTC
0 reputation · 18 Aug 2024, 18:07 UTC
The goal is to guarantee that events sent from a Splunk forwarder are written to an index only once, even when transient network failures trigger retries. The forwarder can be configured with indexer_ack = true and a retry stanza, while the indexer may reject duplicates based on event IDs. However, it is unclear whether this combination provides true exactly‑once delivery or if duplicates can still slip through.
indexer_ack forces the forwarder to wait for acknowledgement before clearing its buffer.retry stanza controls the number of resend attempts and back‑off strategy.duplicate_check, but the interaction with event IDs is version‑dependent.dedup search command removes duplicates at search time, not ingestion time.indexer_ack together with the default retry policy guarantee that a retried event is not written twice, or can duplicates still appear if the indexer acknowledges before dedup logic runs?duplicate_check setting when indexer_ack is true, and how does it interact with the event’s event_id field across recent Splunk Enterprise releases?dedup or configure indexer‑level duplicate detection to achieve exactly‑once semantics, and what trade‑offs exist between the two approaches?31775 reputation · 19 Aug 2024, 02:43 UTC
Enabling indexer_ack = true and the retry stanza only guarantees that the forwarder keeps an event in its queue until an explicit ACK is received. It does not by itself prevent a duplicate from being written if the indexer has already ACKed the event and the forwarder retries after a timeout or restart. To achieve true exactly‑once delivery you must also enable duplicate_check = true on the indexer and ensure every forwarded event carries a stable, unique event_id (or _guid) field. Without that field the indexer cannot recognize a retry as a duplicate, and a second copy will be indexed.
indexer_ack only controls the forwarder’s local buffer clearing.retry stanza dictates how many times the forwarder will re‑send an event after a failure, but it does not check whether the event was already written.duplicate_check is off or the event lacks a unique key, the indexer will happily accept the resend.dedup merely hides duplicates in query results and does not affect the indexed data volume.duplicate_checkIn Splunk Enterprise 7.x and 8.x the indexer calculates a hash of the event’s event_id (or _guid if present) before it writes the event to disk. If the hash matches an existing entry, the event is discarded and a duplicate_check drop is logged. The exact field used and the timing of the check (before or after the ACK is recorded) can vary between major releases, so it is essential to confirm the behaviour on your specific version.
duplicate_check = true in the indexer’s indexes.conf for the target index.event_id (or _guid) with a deterministic value for each event.event_id and send it with indexer_ack = true.metrics.log for a retry counter and the indexer’s splunkd.log for a duplicate_check drop message.| metrics | search type=forwarder | stats avg(queue_size) by index to observe queue behaviour during retries.retry stanza’s max_attempts or back‑off settings if you see excessive retries without dedup drops.To refine this configuration, could you confirm:
duplicate_check = true enabled?Answering these will help us determine if any additional tuning is required.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.