Courseiva
Transactions and Event CorrelationhardMultiple ChoiceObjective-mapped

How to Replace transaction with stats for Better Performance

A large enterprise runs Splunk Enterprise with 500 servers forwarding Windows security logs. The security team wants to correlate failed logins (EventCode 4625) with subsequent successful logins (EventCode 4624) from the same source IP within a 5-minute window. They currently use the following search: index=windows sourcetype=WinEventLog:Security (EventCode=4625 OR EventCode=4624) | transaction src_ip maxpause=5m | search EventCode=4625 AND EventCode=4624. This search is extremely slow and often times out. Which approach would improve performance while maintaining the same correlation logic?

Quick Answer

The answer is to replace transaction with a combination of stats and where. This approach improves performance because stats operates as a streaming command, processing events one at a time and aggregating them in memory far more efficiently than transaction, which holds all matching events in memory until the entire transaction closes—a major bottleneck when correlating thousands of Windows security logs across 500 servers. On the Splunk SPLK-1003 exam, this question tests your understanding of how to optimize transaction performance using stats, specifically the trade-off between memory-intensive correlation commands and streaming alternatives. A common trap is assuming that increasing maxpause or maxevents will help, but that only makes the transaction larger and slower. Remember the memory tip: “Transaction holds, stats folds”—transaction holds events until timeout, while stats folds them into a single result set, making it the leaner choice for correlating failed and successful logins by source IP within a time window.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Replace transaction with a combination of stats and where that groups by src_ip and then filters for pairs.

Using stats and where is more efficient than transaction. Transaction holds all events in memory until the transaction is closed, which is memory-intensive when dealing with many events like 500 servers. The stats command can group events by src_ip, then the where command can filter for pairs of EventCode 4625 and 4624 within the same group. This approach leverages streaming capabilities and reduces memory overhead. Option A is incorrect because the append command does not correlate events by source IP; it merely concatenates results from two separate searches. Option B is incorrect because adding maxevents=1000 (already default) limits the number of events per transaction but does not address the underlying memory consumption issue of transaction. Option C is incorrect because increasing maxpause to 10 minutes would allow more events per transaction, making the search even slower and more prone to timeout.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the append command to combine the two event types after separate searches.

    Why it's wrong here

    Append does not correlate by src_ip; it just concatenates results.

  • Add maxevents=1000 to the transaction command to limit event count.

    Why it's wrong here

    The default maxevents is already 1000; this would not change behavior.

  • Increase maxpause to 10 minutes to allow more events per transaction.

    Why it's wrong here

    Increasing maxpause would allow larger transactions, increasing memory usage and timeouts.

  • Replace transaction with a combination of stats and where that groups by src_ip and then filters for pairs.

    Why this is correct

    Using stats with values and where reduces memory overhead and improves performance.

About these practice questions

Courseiva writes every SPLK-1002 question from scratch — 475 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on SPLK-1002

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A search uses `transaction sessionId` to correlate events. However, the transaction command is consuming too much memory and the search fails. Which approach can reduce memory usage while still approximating the transaction grouping?

medium
  • A.Add `maxevents=100` to the transaction
  • B.Use `dedup sessionId`
  • C.Use `stats values(_raw) by sessionId`
  • D.Increase the search job memory limit

Why C: Using `stats values(_raw) by sessionId` aggregates raw events into a multivalue field, which is more memory-efficient than transaction because it does not try to compute duration or keep all event metadata.

Variation 2. A security team notices that using `transaction` on a large dataset of firewall logs causes memory issues. Which alternative approach would most efficiently correlate events while reducing resource consumption?

hard
  • A.Use `concurrency` command to group events
  • B.Increase `maxtransize` and `maxopentxn` in limits.conf
  • C.Use `append` with subsearch to join events
  • D.Use `stats` by session_id list(src_ip), list(dest_ip) with `bin` time

Why D: Using `stats` with `list()` and `bin` time is more memory-efficient than `transaction` for correlating events by session_id. `transaction` creates a transaction object with all event details, consuming more memory, while `stats` aggregates fields without storing raw events. Options A (`concurrency`) is for analyzing concurrent events, not correlation; B (increasing limits) only postpones issues; C (`append`) is for combining results, not efficient correlation.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SPLK-1002 practice question is part of Courseiva's free Splunk certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SPLK-1002 exam.