Courseiva
Transactions and Event CorrelationeasyMultiple ChoiceObjective-mapped

How to Properly Use Startswith/Endswith in Transaction

A Splunk user wants to group web server logs into transactions representing a single user visit, where a visit starts with a 'GET' request and ends with a 'POST' request. Which transaction command syntax correctly implements this logic?

Quick Answer

The correct transaction syntax is `transaction startswith="GET" endswith="POST"`. This works because the `transaction` command groups sequential events into a single logical unit, and the `startswith` and `endswith` arguments explicitly define the boundary events that open and close the transaction—here, a GET request marks the beginning of a user visit, and a POST request marks its end. On the Splunk SPLK-1003 exam, this question tests your understanding of how to implement sessionization without overcomplicating the syntax; a common trap is adding unnecessary options like `maxevents` or `by` fields when the basic boundary logic is all that’s required. To remember the correct transaction syntax with startswith and endswith, think of it as a sandwich: the startswith is the top slice of bread, the endswith is the bottom slice, and all events in between are the filling—no extra ingredients needed for a simple visit.

⚠ Common exam trap

Splunk often tests the misconception that `maxevents` is required to limit transaction size, but here the trap is that candidates add unnecessary constraints (like `maxevents=2` or `by src_ip`) that alter the intended grouping logic, or they reverse the `startswith` and `endswith` values, failing to match the required visit flow.

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

transaction startswith="GET" endswith="POST"

The `transaction` command with `startswith="GET"` and `endswith="POST"` correctly groups events into a transaction that begins with a GET request and ends with a POST request, matching the requirement for a single user visit. Options A and D add unnecessary constraints (`maxevents=2` or `by src_ip`) that alter the intended grouping logic, and option B reverses the start and end events, which does not match the specified visit flow.

Answer analysis

Option-by-option breakdown

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

  • transaction startswith="GET" endswith="POST" maxevents=2

    Why it's wrong here

    Incorrect because it adds `maxevents=2`, which limits the transaction to two events. A user visit may involve more than two events (e.g., multiple GETs and POSTs), so this constraint is unnecessary and may miss valid transactions.

  • transaction startswith="POST" endswith="GET"

    Why it's wrong here

    Incorrect because it reverses the start and end events. A visit should start with GET and end with POST, not start with POST and end with GET.

  • transaction startswith="GET" endswith="POST"

    Why this is correct

    Correct. `transaction startswith="GET" endswith="POST"` groups events into a transaction that begins with a GET request and ends with a POST request, matching the requirement for a single user visit without unnecessary constraints.

  • transaction by src_ip startswith="GET" endswith="POST"

    Why it's wrong here

    Incorrect because adding `by src_ip` groups transactions by source IP. While this could be useful for separating different users, the requirement did not specify grouping by IP, and the simplest correct answer without extra fields is C.

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

1 more way 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 security team needs to group all login events from the same user session. Events include 'login' and 'logout' with a common session_id field. Which command should be used to combine these events into a single event per session?

easy
  • A.join session_id
  • B.stats by session_id
  • C.transaction session_id
  • D.append session_id

Why C: The `transaction` command is designed to group related events based on common fields and time constraints, making it ideal for combining login and logout events by session_id.

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.