Which command is used to display specific fields in the output?
The `fields` command explicitly includes or excludes named fields from results, satisfying the requirement to display only specific fields. Unlike `table`, which also reorders columns, `fields` preserves the existing field order and is the documented SPL command for selecting which fields appear in output.
Why this answer
The fields command is used to display specific fields in the output of a search. By specifying fields field1, field2, you instruct Splunk to include only those fields in the results, effectively displaying just the fields you need. This is the standard SPL command for controlling which fields appear in search output.
Exam trap
SPLK-1004 often tests whether candidates confuse the fields command with SQL-like commands such as select or show, tempting them to choose options that do not exist in Splunk's SPL.
How to eliminate wrong answers
Option A is wrong because 'display' is not a valid Splunk SPL command — it does not exist in the search processing language. Option B is wrong because 'select' is not a Splunk SPL command; it is a SQL keyword and has no equivalent function in Splunk searches. Option D is wrong because 'show' is not a valid SPL command for displaying fields — while some commands like show source or show sourcetype exist in specific contexts, 'show' alone is not used to select fields for output.