SPLK-1001 practice question 17 of 30

How do you add or remove fields from search results?

Full set: 244 questions

Domain Using Fields in Searches

Answer options
A: Use field +to add and field -to remove.
B: Use table +to add and table -to remove.
C: Use fields +to add and fields –to remove. Correct answer
D: Use fields Plus to add and fields Minus to remove.
Correct Answer:
C. Use fields +to add and fields –to remove.
Explanation

In Splunk's Search Processing Language (SPL), the fields command is used to control which fields are kept in the search results. To add specific fields to the default set of fields (like time, host, source, sourcetype), you use the fields command followed by a plus sign (+) and the field names. Conversely, to remove or exclude specific fields from the results, you use the fields command followed by a minus sign (-) and the field names. This allows for precise control over the data displayed.

Why Incorrect

A. The command is fields (plural), not field (singular). This is a common syntax error.
B. The table command is used to display results in a tabular format, but it does not use the + or - syntax to include or exclude fields.
D. SPL commands use symbolic operators like + and -, not the spelled-out words "Plus" and "Minus".

References

1. Splunk Enterprise Documentation. (2023). Search Reference

"fields" command.

Section: Description and Syntax. The documentation states

"A plus (+) or minus (-) sign is used to specify whether you are including or excluding fields from the results." It provides the syntax fields [ | (+ | -) ].

2. Splunk Enterprise Documentation. (2023). Search Tutorial

"Use the fields command".

Section: Step 4: Use the fields command. This tutorial section explicitly demonstrates the usage: "To remove fields from your results

you specify the fields to remove with a minus sign (-). For example

... | fields - date" and "To specify the fields to include in your results

you use the plus sign (+). For example

... | fields + clientip

action

status".

Scroll to Top