SPLK-2001 practice question 15 of 15
Which of these URLs could be used to construct a REST request to search the employee KV store collection to find records with a rating greater than or equal to 2 and less than 5?
Full set: 66 questionsThe correct URL must use the KV Store REST API endpoint and provide a valid, URL-encoded, MongoDB-style query. The query needs to combine two conditions using a logical $and operator: rating is greater than or equal to 2 ($gte: 2) and rating is less than 5 ($lt: 5). Option D correctly constructs this query as a JSON object {"$and":[{"rating":{"$gte":2}},{"rating":{"$lt":5}}]} and properly URL-encodes it for use as a query parameter. The base endpoint and outputmode parameter are also correct.
A. This option is not URL-encoded, which is required for special characters in a URL. It also uses an invalid parameter outputmode-json (with a hyphen instead of an equals sign).
B. The JSON syntax for the query is invalid. The first condition rating:$gte:2 is missing the required curly braces {} around the $gte:2 part, making it un-parsable.
C. The decoded JSON query {"rating":{"$gte":2}},{"$and"},{"rating":{"$lt":5}}} is structurally incorrect. The $and operator must be a key whose value is an array of the conditions to be joined.
1. Splunk REST API Reference Manual: The documentation for the storage/collections/data/{collection} endpoint specifies the use of the query parameter to filter results. It states
"The query parameter must be a URL-encoded
JSON-formatted
MongoDB-style query."
Source: Splunk Enterprise 9.2.1
REST API Reference Manual
"storage/collections/data/{collection}" endpoint documentation
Parameters section.
2. Splunk Developer Guide: This guide provides examples and details on using the KV Store
including the syntax for queries. The query syntax is based on MongoDB
where the logical $and operator takes an array of condition documents. The structure {$and: [ { }
{ } ]} is the correct format.
Source: Splunk Developer Guide
Use the KV Store REST API
"Retrieve records from a collection" section. This section details the query parameter and its MongoDB-style JSON format.
Keep practicing
Take the free SPLK-2001 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SPLK-2001 practice questions
- Question 1Searching “index=_internal metrics | head 3” from Splunk Web returned the following event…
- Question 2In order to successfully accelerate a report, which criteria must the search meet? (Selec…
- Question 3After updating a dashboard in myApp, a Splunk admin moves myApp to a different Splunk ins…
- Question 4How can indexer acknowledgement be enabled for HTTP Event Collector (HEC)? (Select all th…
- Question 5Which of the following is an example of a Splunk KV store use case? (Select all that appl…
- Question 6Data can be added to a KV store collection in which of the following format(s)?
