SPLK-1004 practice question 10 of 10
Which is generally the most efficient way to run a transaction?
Full set: 117 questionsDomain Splunk Cloud Platform and Data Security
The transaction command is one of the most resource-intensive commands in Splunk because it is stateful, requiring significant memory and CPU to process. It must compare events and hold them in memory to group them into transactions. In contrast, the stats command is a streaming command that is far more efficient for grouping events based on one or more fields. For many use cases, a search using stats with functions like values(), earliest(), and latest() can achieve the same result as a transaction search but with substantially better performance. Therefore, rewriting the query to use stats is generally the most efficient approach.
A. Smart Mode automatically switches to the resource-heavy Verbose Mode when it encounters transforming commands like transaction, so it does not improve efficiency.
B. While sorting is often necessary for transaction, adding an explicit | sort command before it introduces another layer of processing, which typically decreases overall efficiency.
C. The transaction command requires full event data and cannot run in Fast Mode, which disables the necessary field and event discovery for performance gains.
1. Splunk Enterprise Documentation, Search Manual, "transaction command":
Usage Section: "The transaction command can be resource-intensive. In many cases, you can use the stats command to get the same or similar results more efficiently. [...] Before you use the transaction command, read the topic 'Stats versus transaction' in this manual." This directly supports that stats is more efficient.
2. Splunk Enterprise Documentation, Search Manual, "Stats versus transaction":
Performance considerations: "The transaction command is more expensive than the stats command. The transaction command must hold the raw events in memory while it determines which events are part of a transaction. The stats command needs only the field values that it is operating on." This explains why stats is more efficient.
3. Splunk Enterprise Documentation, Search Manual, "Search modes":
Smart mode: "Switches between Fast and Verbose modes based on the type of search you are running. [...] For searches that include transforming commands such as stats, chart, timechart, and top, the search mode switches to Verbose." This confirms that using transaction forces a switch to the less efficient Verbose mode.
Fast mode: "Field discovery is disabled. [...] This mode does not generate the data necessary for post-process searches, such as event sampling." This explains why transaction is incompatible with Fast Mode.
Keep practicing
Take the free SPLK-1004 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SPLK-1004 practice questions
- Question 1Which of the following can be used to access external lookups?
- Question 2What capability does a power user need to create a Log Event alert action?
- Question 3Repeating JSON data structures within one event will be extracted as what type of fields?
- Question 4Which of the following is true about Log Event alerts?
- Question 5Which of the following statements is accurate regarding the append command?
- Question 6Which statement about the coalesce function is accurate?
