SPLK-1001 practice question 13 of 30
Which stats command function provides a count of how many unique values exist for a given field in the result set?
Full set: 244 questionsDomain Using Basic Transforming Commands
The stats command in Splunk uses various functions to perform calculations on search results. To count the number of unique (or distinct) values for a specific field, the distinctcount() function is used. The dc() function is the officially documented and commonly used alias for distinctcount(). It iterates through the results and returns a count of how many different values appear for the specified field.
B. count(field): This function returns the total number of events that contain the specified field, not the count of its unique values.
C. count-by(field): This is not a valid stats function. The by clause is a part of the stats command syntax itself (e.g., ... | stats count by field), not a function.
D. distinct-count(field): This syntax is incorrect due to the hyphen. The correct function name is distinctcount(field), for which dc(field) is the accepted alias.
1. Splunk Enterprise Documentation
Search Reference
"stats command".
Section: Statistical and charting functions
Content: The documentation lists dc() as an alias for distinctcount(). It defines distinctcount() as the function that "Returns a count of the unique values of the field." This directly supports option A. The same section defines count() as returning "a count of the number of occurrences of the field
" which invalidates option B.
2. Splunk Enterprise Documentation
Search Reference
"Statistical and charting functions".
Section: Function list
Content: This page provides a comprehensive list of functions for commands like stats
chart
and timechart. It explicitly lists dc() as the alias for distinctcount() and confirms the absence of count-by() or distinct-count() (with a hyphen) as valid functions
thereby invalidating options C and D.
Keep practicing
Take the free SPLK-1001 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SPLK-1001 practice questions
- Question 1Which command is used to review the contents of a specified static lookup file?
- Question 2What are the three main Splunk components?
- Question 3By default, which of the following fields would be listed in the fields sidebar under int…
- Question 4Splunk extracts fields from event data at index time and at search time.
- Question 5You can view the search result in following format (Choose three.):
- Question 6This search will return 20 results. SEARCH: error | top host limit = 20
