SPLK-1001 practice question 24 of 30

What syntax is used to link key/value pairs in search strings?

Full set: 244 questions

Domain Search Language Fundamentals

Answer options
A: action+purchase
B: action=purchase Correct answer
C: action | purchase
D: action equal purchase
Correct Answer:
B. action=purchase
Explanation

In Splunk's Search Processing Language (SPL), the equals sign (=) is the operator used to link a field (the key) with its corresponding value. This syntax, field=value, is fundamental for filtering search results to include only events where the specified field contains the exact value. For example, the search string action=purchase will return events where the action field has a value of "purchase". This is the primary method for performing exact-match filtering on field-value pairs.

Why Incorrect

A. action+purchase: The plus sign (+) is an arithmetic operator used within commands like eval for addition, not for linking fields and values in a search filter.
C. action | purchase: The pipe character (|) is a command separator used to pass the results of one command to the next command for further processing.
D. action equal purchase: The word "equal" is not a valid SPL operator for field-value matching in a search string; the symbol = must be used.

References

1. Splunk Enterprise Documentation, Search Manual, "Use fields in searches": This section explicitly states the syntax for searching fields: "To search for a value in a field, use the syntax =. This search finds events where the value of is equal to ." (Splunk Docs, Search Manual, Version 9.2.1, Part of: Get started with Search).

2. Splunk Enterprise Documentation, Search Reference, "search command": The syntax overview for the search command demonstrates the use of field-value pairs. It provides examples such as sourcetype=accesscombined status=200, confirming that = is the correct operator for equality matching. (Splunk Docs, Search Reference, Version 9.2.1, Part of: Search commands).

Scroll to Top